Write a program that can accept two inputs - a food type and a price, and...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program that can accept two inputs - a food type and a price, and determines if the food is affordable or expensive. This program should use an if-statement to determine. If the cost of the food is over $20, then the program should say it is expensive, and otherwise it should say it is affordable (this is arbitrary - for the purposes of making this problem simple). Below are a few examples: Enter food: hamburger Enter price: 30 That hamburger is expensive. Enter food: prime rib Enter price: 5 That prime rib is affordable. Write a program that can accept two inputs - a food type and a price, and determines if the food is affordable or expensive. This program should use an if-statement to determine. If the cost of the food is over $20, then the program should say it is expensive, and otherwise it should say it is affordable (this is arbitrary - for the purposes of making this problem simple). Below are a few examples: Enter food: hamburger Enter price: 30 That hamburger is expensive. Enter food: prime rib Enter price: 5 That prime rib is affordable.
Expert Answer:
Answer rating: 100% (QA)
Youve asked for help with writing a program that takes two inputs a type of food and its p... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
You're given the following supply and demand tables: a. What is equilibrium price and quantity in a market system with no interferences? b. If this were a third-party-payer market where the consumer...
-
Ivanhoe Company incurred research and development costs of $ 9 0 0 0 0 to develop a patent, and legal fees of $ 3 0 0 0 0 to register the patent. The patent has a legal life of 2 0 years and a useful...
-
Prepare a sensitivity analysis question with an Excel Sensitivity analysis report and answer it. Make sure your question asks about the following a. Optimal solution b. Optimal objective function c....
-
If the dragonfly approaches its prey with a speed of 0.950 m/s, what angle u is required to maintain a constant line of sight parallel to the x axis? A. 37.9 B. 38.3 C. 51.7 D. 52.1
-
f(x ) = (12/px)+x , where p is a real constant and x > 0. Given that f'(2) = 3, find p, giving your answer in the form a2 where a is a rational number.
-
For a linear viscoelastic material, the creep response under a constant stress is followed by a "recovery response" after the stress is removed at some time, \(t_{0}\). Using the Boltzmann...
-
Use Worksheet 5.1. Damien Smart is trying to decide whether to lease or purchase a new car costing $18,000. If he leases, hell have to pay a $600 security deposit and monthly payments of $425 over...
-
Discuss the cultural differences between China and the United States. What would be the biggest adjustments I might need to make if working there as an expatriate? What are the most...
-
PhotoTech, Inc., a manufacturer of rechargeable batteries for digital cameras, signed a contract with a digital photography company to produce three different lithium-ion battery packs for a new line...
-
In 2018 a grandfather gave a life estate to his grandson and a remainder interest to his grand daughter, each interest is valued at $15,000. The gift to the granddaughter is?
-
Sample input: Once you have the frequencies, implement the Huffman encoding to derive the binary code tree. Sample output: 0.12 0.09 0.08 0.07 0.07 0.07 0.01 E N T 0.51 0 N Activate Win
-
54. Use the following to answer questions (a)-(e): The work experiences (in years) of 14 employees of a company are 8 8 21 8 11 7 4 2 a. The first quartile for these data is: 14 11 17 27 b. The...
-
Define a set of boolean formulas by: For each i N, the "variable" x; F. If pe F then (-p) EF. If p, q E F then (p^q) EF and (pv q) EF. Nothing else is in F. Define T,N: F F by: . For each i EN, T(x;)...
-
Assume we have two firms that have the same earnings per share ($10). Firm A has a P/E ratio of 5 and Firm B has a P/E ratio of 40. Assume that investors do not expect the P/E ratio for Firm A to...
-
You own a property on Main Street on which a small, vacant take-out pizza stand sits. There are other vacant take-out pizza stands in the same locale (i.e. Main Street) as well as on the less busy...
-
Which of the following journal entries would be used to record a variance that arose when materials with a standard price of $5.00 per unit were purchased at a price of $4.00 per unit a. Direct...
-
Ask students to outline the reasons why the various elements of culture (social structures and control systems, language and aesthetics, religion and other belief systems, educational systems, etc.)...
-
Early explorers often estimated altitude by measuring the temperature of boiling water. Use the following two equations to make a table that modem-day hikers could use for the same purpose. p =...
-
Make a 3-D surface plot of the function z = 0.5x2 + 0.5y2 in the domain -2 < x < 2 and -2 < y < 2.
-
When rubber is stretched, its elongation is initially proportional to the applied force, but as it reaches about twice its original length, the force required to stretch the rubber increases rapidly....
-
The accountant for Elite Security Services Ltd reviewed the following information for accounts receivable: For the financial year 2022 - 2023 1. At 1 July 2022, Allowance for Doubtful Debts had an...
-
On 1 June, Sugar Rush Ltd had Accounts Receivable and Allowance for Doubtful Debts accounts as below. GST Inclusive. The following transactions occurred during the month of June: 5. Credit sales...
-
Outback Get Away Ltd sells four-wheel drive accessories and recovery equipment on credit. The accounting records at 30 June 2023 highlights the following. Ignore GST. In the past, the companys yearly...
Study smarter with the SolutionInn App