Exercise . Create three arrays as defined below that contains the information based on cars: carName...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Exercise . Create three arrays as defined below that contains the information based on cars: carName = {"Ford", "BMW", "Mercedes", "Chevrolet"} %3D carCountry = {"American", "German", "German", "American"} carPrice = (10000, 12000, 13000, 12500} a. In your main, create a program that asks the user for two integer values between 1 and 4, inclusive. Using the array, your program should print out the names of cars and country of manufacturing corresponding to the numbers the user entered. Your program must REJECT any numbers that's outside this range. b. On a new line, print which car is a cheaper option. An example printed output for Q1 could be: "Please enter two numbers: 43 The cars you chose are Chevrolet which is American made, and Mercedes which is German made. The price of Chervrolet: 12500 is cheaper than Mercedes: 13000" Exercise . Create three arrays as defined below that contains the information based on cars: carName = {"Ford", "BMW", "Mercedes", "Chevrolet"} %3D carCountry = {"American", "German", "German", "American"} carPrice = (10000, 12000, 13000, 12500} a. In your main, create a program that asks the user for two integer values between 1 and 4, inclusive. Using the array, your program should print out the names of cars and country of manufacturing corresponding to the numbers the user entered. Your program must REJECT any numbers that's outside this range. b. On a new line, print which car is a cheaper option. An example printed output for Q1 could be: "Please enter two numbers: 43 The cars you chose are Chevrolet which is American made, and Mercedes which is German made. The price of Chervrolet: 12500 is cheaper than Mercedes: 13000"
Expert Answer:
Answer rating: 100% (QA)
C Code include using namespace std int main int xy ... View the full answer
Posted Date:
Students also viewed these programming questions
-
Write a C++ program that asks a user for an integer, reads it, and outputs one of the following: foo: if the integer is a multiple of 3 bar: if the integer is a multiple of 5 foobar: if the...
-
Write a Java program that accepts two integer values between 25 to 75 and returns true if there is a common digit in both numbers. Sample Output: Input the first number: 35 Input the second number:...
-
Factoring of integers. Write a program that asks the user for an integer and then prints out all its factors. For example, when the user enters 150, the program should print 2 3 5 5
-
Problem 5-47 Amortizing Loans and Inflation (LO3) Suppose you take out a $108,000, 20-year mortgage loan to buy a condo. The interest rate on the loan is 5%. To keep things simple, we will assume you...
-
The average annual total return for U.S. Diversified Equity mutual funds from 1999 to 2003 was 4.1% (BusinessWeek, January 26, 2004). A researcher would like to conduct a hypothesis test to see...
-
Castle View Games would like to invest in a division to develop software for video games. To evaluate this decision, the firm first attempts to project the working capital needs for this operation....
-
You are working on charge-storage devices for a research center. Your goal is to store as much charge on a given device as possible. The facilities allow you to generate almost any potential...
-
YellowCard Company manufactures accessories for iPods. It had the following selected transactions during 2012. 1. YellowCard provides a 2-year warranty on its docking stations, which it began selling...
-
In a jurisdiction where assisted suicide is illegal, a terminally ill patient with no chance of recovery seeks assistance in ending their life. What legal and ethical considerations come into play,...
-
Troys Tires sells a certain brand tire which has a daily demand that is normally distributed, with a mean of 15 tires and a standard deviation of 4 tires. (In your model use integers for all...
-
Moon is a furniture company manufacturing different types of furniture. One of its products Double Bed is very popular because of its unique design and comfort. Company has two divisions Bed Division...
-
General Manufacturing, Inc. (GMI), issues bonds to finance the purchase of a factory. Regarding those bonds, which of the following is true? a. The bonds must be repaid. b. The bondholders will...
-
Infinity Credit LLC makes loans to consumers secured by their homes. An Infinity Credit loan is an adjustable-rate mortgage if its interest rate a. adjusts periodically. b. changes with the consumers...
-
What is an automatic stay?
-
U.S. Digital Corporation incorporated in Ohio, its only place of business. Its stock is owned by ten shareholders. Two are resident aliens. Three of the others are the directors and officers. The...
-
Will Sukenik and Irvin Fine formed PDC Office Park as general partners. Under the partnership agreement, on the death of one partner, the other had thirty days to elect to continue the partnership....
-
For each tranFor each transaction, indicate the change, if any, in total assets and total equity. If equity changes, indicate whether the change was reflected as a component of net income, or...
-
Listed below are common types of current liabilities, contingencies, and commitments: a. Accounts payable b. Bank loans and commercial paper c. Notes payable d. Dividends payable e. Sales and excise...
-
Discuss how yields anticipate future economic activity.
-
Select the circumstance in which the impact on government bond yields of a new source of revenue (such as a natural resource discovery) would be largest. Explain your choice. a. Before the discovery,...
-
Suppose that the interest rate on one-year bonds is 4 percent and is expected to be 5 percent in one year and 6 percent in two years. Using the expectations hypothesis, compute the yields in two- and...
Study smarter with the SolutionInn App