Concept explainers
Write a switch statement to convert a letter grade into an equivalent numeric value on a four-point scale. Set the value of the variable gradeValue to 4.0 for an A, 3.0 for a B, 2.0 for a C, 1.0 for a D, and 0.0 for an F. For any other letter, set the value to 0.0 and display an error message.
Want to see the full answer?
Check out a sample textbook solutionChapter 3 Solutions
Java: An Introduction to Problem Solving and Programming (8th Edition)
Additional Engineering Textbook Solutions
Java How to Program, Early Objects (11th Edition) (Deitel: How to Program)
Starting Out With Visual Basic (8th Edition)
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Starting Out with C++ from Control Structures to Objects (9th Edition)
INTERNATIONAL EDITION---Engineering Mechanics: Statics, 14th edition (SI unit)
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
- Create a flowchart diagram that will input temperature in Fahrenheit, convert it to Celsius and output the corresponding Thermal Sensation according to the table given below:arrow_forward. It must be determined whether the beach is to be closed or not. Right after the average has been output, you will need an if statement to decide whether the beach is to be closed or not. If the average is below 3500 print out the beach number and a short message that the beach is safe; if greater than or equal to 3500 print out the beach number and a short message that the beach is closed. , add a report to count the total number of beaches in the file and how many are open, and how many are closed. //include the required header file. #include "stdio.h" //Define the main function. int main(void) { //Declare the variable. int b_num, num_samples, num_orgs_per_100; char c = 'a'; //Create a file pointer. FILE *in_file; //Open the file in read mode. in_file = fopen("inp.txt", "r"); //Check if the file exists. if (in_file == NULL) printf("Error opening the file.\n"); //Read the data from the file. else { //Get the…arrow_forwardCreate a flowchart diagram that will input temperature in Fahrenheit, convert it to Celsius and output the corresponding Thermal Sensation according to the table given below:arrow_forward
- Assign the sum of x and y to w, and increment x by 1 with ++. Use only one statement and ensure that original value of x is used in statement.arrow_forwardEvaluate the following expression. Give the final value of x. Your answer is either a 1 or a 0 if the answer is a true or a false. x = 'a'> 'b' && 'c' == 'C'arrow_forward.Draw a flowchart that will read and print the names and individual score of 50 students for a particular examination. Also, determine the average score and print it.arrow_forward
- Given a character variable named ch, write a switch statement that prints out the word “winner” if the value of ch is ‘w’, the words “first place” if the value of ch is ‘f’, the words “second place”, if the value of ch is ‘s’, the words ”third place” if the value if ch is ‘t’, and the words “honorable mention” if the value of ch is anything else.arrow_forwardPlease answer the three question I'll rate!arrow_forwardThe following flowchart contains several errors. Correct them and re-draw the correct flowchart and give reason/explanation for each of those errors.arrow_forward
- Write a statement that converts PI to an angle in degrees and assigns the result to a variable.arrow_forwarduse the RUSTarrow_forwardCreate a flowchart that will compute for the grade of students and print its equivalent grade point. The formula for computing the grade is : GRADE = 10% assignment + 20% seatwork + 30% quiz + 40% exam. Equivalent Grade point ---------------------- 1.0 - 99-100 1.25 - 96-98 1.50 - 93-95 1.75 - 90-92 2.0 - 87-89 2.25 - 84-86 2.50 - 81-83 2.75 - 78-80 3.0 - 75-77 5.0 - below 75arrow_forward
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning