subject

This project has the following requirements. General Requirements
Ask the user to input what value they are interested in.
Output to the user a sorted list of the top 5 items based on the option.
Specific Requirements:
The main function must meet these requirements:
The code will continue to ask the user for additional input until the user inputs the value 12 for the menu
The code will call both of the functions described below
The code will read the data file - you should only need to read the data file one time, so you can do that prior to entering the loop mentioned above.
The code will also contain the following 2 functions, with the specified arguments:
printMenu()
this function has no arguments
this function prints the menu shown below
Select from the following options:.
1) Category
2) Item
3) Serving Size
4) Calories
5) Calories from Fat
6) Total Fat
7) Cholestrol
8) Sodium
9) Carbohydrates
10) Protein
11) Sugars
12) Quit
Enter Number Command:.
validate the input value from the menu to ensure it is numerical using the try/except
validate that the value input is one of the menu values - 1 through 12
this function will return the value entered by the user to the main function
processInput( userInput )
there is a single argument. This is the value entered by the user in response to the menu. This value is returned from the printMenu()
function then passed to the processInput() function
the function will sort the data according to the user input, and print out the top 5 entries
the function does not return any value
Phase 1 Requirements:
Code submitted for Phase 1 will only have the following capability. Any additional coding will result in the loss of point.
code will have the main function, including looping until the user enters input of 12
code will call the printMenu() function
theprintMenu() function will have the capability to print the menu and receive input. AT THIS TIME do not worry about implementing the try/except code
the code MUST return the value entered by the user - IT IS NOT REQUIRED to return an integer - BUT - the code MUST return the value (remember - the input() function returns a string) entered by the user to the main function. Some students figure out a way to use the string value, so you do not have to return an integer.
the main function will have a simple print statement outputting the statement "The user input the value ??" - where the ?? will be replaced by the value the user entered.
Phase 2 Requirements:
code will meet all requirements from Phase 1
code in the printMenu() function will be added to include a try/except to catch errors if the user enters a non-numeric value in response to the menu prompt.
code in printMenu() will also need to check for input of values outside the range of 1-12, and handle them appropriately.
code will have the main function calling the processInput() function that accepts a single argument
the argument to the function will be the value returned from the printMenu() function
use a different variable name in your main code and in your function
create a list named headings[ ]
the headings list should contain all the Headings from the menu except 'Quit'...so you have all 11 elements in the list from your menu.
using the value that is passed into the processInput() function print not only the numerical value of that argument - but also print the proper item from the headings[ ] list.
Phase 3 Requirements:
code will meet all requirements from Phase 2
code to read the input file will be added to the main function
the processInput() function will sort the data read from the file
the processInput() function will print out the top 5 items based on the input value
You can test your code - below are two input values and the output you should see.
Enter a value 4
Top 5 Items Based On Calories:
1| "Chicken McNuggets (40 piece)" 1880
2| "Big Breakfast with Hotcakes (Large Biscuit)" 1150
3| "Big Breakfast with Hotcakes (Regular Biscuit)" 1090
4| "Big Breakfast with Hotcakes and Egg Whites (Large Biscuit)" 1050
5| "Big Breakfast with Hotcakes and Egg Whites (Regular Biscuit)" 990
Enter a value 7
Top 5 Items Based On Cholesterol :
1| "Big Breakfast with Hotcakes (Regular Biscuit)" 575
2| "Big Breakfast with Hotcakes (Large Biscuit)" 575
3| "Big Breakfast (Regular Biscuit)" 555
4| "Big Breakfast (Large Biscuit)" 555
5| "Steak & Egg McMuffin" 300

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 01:00
Program description: a c# app is to be created to produce morse code. the morse code assigns a series of dots and dashes to each letter of the alphabet, each digit, and a few special characters (such as period, comma, colon, and semicolon). in sound-oriented systems, the dot represents a short sound and the dash represents a long sound. separation between words is indicated by a space, or, quite simply, the absence of a dot or dash. in a sound-oriented system, a space is indicated by a short period of time during which no sound is transmitted. the international version of the morse code is stored in the data file morse.txt.
Answers: 3
question
Computers and Technology, 22.06.2019 06:30
This technology is used to produce high-quality documents that look good on the computer screen and in print. wiki presentation paint desktop publishing
Answers: 3
question
Computers and Technology, 23.06.2019 18:00
Freya realizes she does not have enough in her bank account to use the debit card. she decides to use a credit card instead. which questions should freya answer before using a credit card? check all that apply. can i pay at least the minimum payment each month? can i make payments on time and avoid late fees? will i have to take out a loan? how much in finance charges can i afford to pay? should i talk to a consumer credit counseling service?
Answers: 1
question
Computers and Technology, 23.06.2019 21:20
In microsoft word, when you highlight existing text you want to replace, you're in              a.  advanced mode.    b.  automatic mode.    c.  basic mode.    d.  typeover mode
Answers: 1
You know the right answer?
This project has the following requirements. General Requirements
Ask the user to input what...
Questions
Questions on the website: 13722363