subject

You have been hired by your favorite restaurant to create a food nutrition app for their customers to use. Before you get too far, the owner wants you to create a quick prototype. Your app should output a food name and the number of calories, then ask the customer how many they want. You need to ask them for 3 menu items. Once they tell you the quantity for the three menu items, you will output the meal’s total calories. Behind the scenes, you are going to create a Food class. Your Food class should use name and calories in the constructor (in that order!). You should create getters and setters for these variables. You also need a toString method that will be used in the line before you ask for the quantity. In addition to the Food class, you will have a FoodRunner class where you will have your main method. In here, you will create your three foods and ask for the quantities. After that, you can use the quantities to calculate and output the total. Sample output: Hamburgers have 600 calories. How many would you like? 2 French Fries have 350 calories. How many would you like? 1 Coke have 200 calories. How many would you like? 2 Your meal will have a total of 1950 calories?

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:30
Which of the following methods could be considered a “best practice” in terms of informing respondents how their answers to an on-line survey about personal information will be protected? respondents are informed that investigators will try to keep their participation confidential; however, confidentiality cannot be assured. respondents are informed that a research assistant will transfer all the research data to a password-protected computer that is not connected to the internet, via a usb flashdrive. the computer is located in a research team member’s office. the investigator uses the informed consent process to explain her institution’s method for guaranteeing absolute confidentiality of research data. the investigator uses the informed consent process to explain how respondent data will be transmitted from the website to his encrypted database without ever recording respondents’ ip addresses, but explains that on the internet confidentiality cannot be absolutely guaranteed.
Answers: 1
question
Computers and Technology, 22.06.2019 10:50
Using least squares fitting, you are to fit the data sets to the following models and solve for the parameters ai , where i is the index of the parameter. the input/output data for the systems are linked in the bblearn site. for each of the systems use matlab to plot the supplied data vs. the model fit on one plot. include your code in the solutions. (a) linear fit "lineardata.mat" y=a1x^3 + a2x^2 + a3x + a4 (b) plant fit "plantdata.mat g(s) = a1/(s + a2)
Answers: 1
question
Computers and Technology, 22.06.2019 17:40
Write a modular program (no classes yet, just from what you learned last year), that allows two players to play a game of tic-tac-toe. use a two-dimensional char array with 3 rows and 3 columns as the game board. each element of the array should be initialized with an asterisk (*). the program should display the initial board configuration and then start a loop that does the following: allow player 1 to select a location on the board for an x by entering a row and column number. then redisplay the board with an x replacing the * in the chosen location. if there is no winner yet and the board is not yet full, allow player 2 to select a location on the board for an o by entering a row and column number. then redisplay the board with an o replacing the * in the chosen location. the loop should continue until a player has won or a tie has occurred, then display a message indicating who won, or reporting that a tie occurred. player 1 wins when there are three xs in a row, a column, or a diagonal on the game board. player 2 wins when there are three ox in a row, a column, or a diagonal on the game board. a tie occurs when all of the locations on the board are full, but there is no winner. input validation: only allow legal moves to be entered. the row must be 1, 2, or 3. the column must be 1, 2 3. the (row, column) position entered must currently be empty (i.e., still have an asterisk in it).
Answers: 1
question
Computers and Technology, 23.06.2019 00:20
Ihave been given the number of guns per 100, and the total firearm-related deaths per 100,000. i have to find the actual number of guns per country and actual number of gun-related deaths. if somebody could show me how to do 1 question, i can finish the rest, i am just confused. tia
Answers: 3
You know the right answer?
You have been hired by your favorite restaurant to create a food nutrition app for their customers t...
Questions
question
Mathematics, 30.04.2021 20:00
question
Social Studies, 30.04.2021 20:00
question
Mathematics, 30.04.2021 20:00
question
Mathematics, 30.04.2021 20:00