Inactive Tutor answered 04/15/24
Kjj M.
asked 04/14/24Write a python program that lets the user enter an account number and then search's the array to see if the number is in the array.
Write a program that lets the user enter an account number and then search's the array to see if the number is in the array.
8149420
5333174
3080098
6755963
9526981
4449539
9387197
5104726
2931356
4282637
1750219
6086650
3164838
2419590
4578589
9718904
6749941
2545408
- Initialize a one-dimensional array with the values above.
- Use the built in sort function to sort the numbers in the array.
- Then use a simple search to locate the number entered by the user in the array.
- If the user enters a number that is in the array, the program should display a message indicating that the account number is valid. If the user enters a number not in the array, the program should display a message indicating it is invalid.
Complete the flowchart using draw.io . Export it as an PDF.
2 Answers By Expert Tutors
Inactive Tutor answered 04/14/24
Hi Kjj!
Just a heads up that tutors don't (or at least should not) do homework for you. And this is definitely a school assignment. HOWEVER, let me give you some guidance.
- Write down the steps you need to take for the program in pseudocode. (Don't skip this step!) They've given you the requirements but you may have to tweak the steps. Think of yourself as the user of this program and not just the programmer. What would you expect of the program? Add that to the pseudocode. Not extra - just little things (or not so little) like how would the user know what the program is asking for, how would you get the input from the user and how would they know what the program is supposed to do with their input.
- Once you're satisfied that you have all the steps you need, create the flowchart with the steps you created in #1. If you need more training on how to use draw.io, see their tutorials at https://drawio-app.com/tutorials/ Double-check that the steps look right with the requirements satisfied.
- NOW you should start coding! If you don't know what you're doing and the curriculum doesn't help, check out sites like W3Schools for help by looking for the specifics. AND, depending on the teacher's rules, make sure to get help from a classmate or even the teacher if you're finding a problem that you can solve - like an error. (That's actually what the teacher is there for - and they are people too, so they understand if you're overwhelmed without a lot of time to work on this - usually.)
- "How to initialize a one-dimensional array in Python with values"
- "How to use the built in sort function to sort numbers in an array in Python"
- "How to use a simple search to locate a number entered by the user in an array in Python"
- "How to get input from a user in Python"
- "How to use an if statement in Python"
You'll be amazed at how it all comes together and how much better you'll feel when you know that you've completed it. Hope it helps!
Still looking for help? Get the right answer, fast.
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.