Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. Prompt the user to enter the first letter of the color of a cylinder. Then use a switch statement, output the contents of the

image text in transcribed
2. Prompt the user to enter the first letter of the color of a cylinder. Then use a switch statement, output the contents of the cylinder to the console screen, using the table below. Include a default statement that prints the following message to the screen if none of the values in column one below are not entered: You have not entered a valid cylinder color, please try the program again." User inputs...For a cylinder of this color... It contains this. -o" or "o" orange Ammonia Carbon Monoxide Hydrogen Oxygen YoryYellow G" or Green Test your program with: a) o (Lower case letter o) b) Y (Upper case letter Y) c)H (Upper case letter H) 3. Write a program to calculate a student's grade based on three test scores, using the guidelines below Prompt the user to enter grades for examl, exam2, and exam3. (datatype double). Determine the letter grade for each student using if-if else- else statements within a given range rather than merely simple if statements. These are the guidelines: If the average score is 90% or more, the grade is A. If the average score is 77% or more and less than 90%, o check the third score. If the third score is more than 90%, the grade is A; otherwise the grade is B If the average score is 50% or more and less than 77%, check the average of the second and third scores. If the average of the two is greater than 75%, the grade is C; otherwise the grade is D If the average score is less than 50% then the grade is F Print the student's letter grade after the if structure has concluded. Test with the following sets of scores: 3 score: 87 3 score: 92 3 score: 61 score: 73 a. Test score: 52 b. Test score: 74 c. Test 1 score: 54 d. Test1 score: 62 Test 2 score: 68 Test 2 score: 82 Test 2 score: 62 Test 2 score: 84 Test Test Test Test

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

Students also viewed these Databases questions