What is the output from the following loop? http://takeexam.next.ecollege.com/Cu
ID: 1925401 • Letter: W
Question
What is the output from the following loop? http://takeexam.next.ecollege.com/CurrentCourse/graphics/midterm/midterm_13.gif
2. (TCO 3) A program has a char variable fruit that has been assigned a value. Write a switch statement that outputs "Apple" if the variable contains lower or upper case 'a', "Banana" if it contains lower or upper case 'b', or "Invalid Input" for any other value.
3. (TCO 3) Create a complete C++ program that prompts the user to enter his or her height in inches and outputs the following:
Output "Height is six feet or more." when the user's height is 6 feet or more.
Output "Height is less than five feet." when the user's height is less than 5 feet.
Output "Height is at least five feet but less than 6 feet" otherwise
4. (TCO 3) Write a complete C++ console mode program (#includes, etc., but no prologue) to ask the user to enter the radius (any positive real number) of a circle. Your program should display the area of a circle with that radius, and the volume of a sphere with that radius. (area = PI * radius2 and volume = PI * 4/3 * radius3 ). The result should be displayed with accuracy to 3 decimal digits (ie. 1.234). Make sure you include all the header files needed to support the operations you use.
a. Use appropriate data types.
b. Make the value of PI (3.14159) a constant in your program.
c. Valid input is any positive real number and zero. If the user input is negative, your program should print an error message and not try to compute any results.
d. Be sure to display explanatory text to make the input and output clear to the user.
5. (TCO 4) Create a C++ program that uses a while-loop to displaythe odd numbers between 15 and 30 including 15. The numbers should be displayed one per line.
6. (TCO 4) Write a complete C++ program that meets the following criteria:
a. Use a do-while loop. Explicitly ask the user if they have more data to enter. Use their answer to decide when the loop is done.
b. The purpose of the loop is to calculate and display the amount of interest for one year given an initial deposit and an interest rate. (interest = deposit * rate)
c. The output from the loop should explain what values are being displayed and display the interest with 2 digits after the decimal point.
d. The loop must ask the user to input the values for the initial deposit and the interest rate. Both values should be treated as real numbers.
e. If either input value is negative, your program should output a message indicating that the input values must be positive numbers. The interest amount should not be displayed in this case.
f. Declare all needed variables using appropriate data types. Initialize as needed.
Explanation / Answer
cant see first question
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.