Java: Intro. to Prob. Solv... (Looseleaf)
7th Edition
ISBN: 9780133841084
Author: SAVITCH
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 3, Problem 11E
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.
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Ask the user for the name?
Ask the user to input five test scores and calculate the total of the test scores and Average of the test Scores.
Using the following 10-point grading scale for the average tests score, display the grade and reward the gift certificate using the formula.
Average testscore
Grade
Gift Certificate formula
90 and above
A
120% of average testscore
80–89
B
60% of average testscore
70–79
C
20% of average testscore
60–69
D
0% of average testscore
Please display Name of the user, five test scores, total, Average test score, Grade and the Gift Certificate amount based on above user input and calculations.
programming language - Python
Which of the following code is not correct ?
Select one:
a.
if val(textbox1.text) >59 then textbox2.text = Pass" Else textbox2.text= "Fail" endif
b.
if val(textbox1.text) >=60 then textbox2.text= "Pass" Else textbox2.text= "Fail" endif
c.
if val(textbox1.text) <60 then textbox2.text = "fail" Else textbox2.text= "Pass"
d.
if val(textbox1.text) <60 then textbox2.text = "fail" Else textbox2.text= "Pass" endif
Write a program that convert one killometer into miles per hour using switch statement
Chapter 3 Solutions
Java: Intro. to Prob. Solv... (Looseleaf)
Ch. 3.1 - Suppose goals is a variable of type int. Write an...Ch. 3.1 - Suppose goals and errors are variables of type...Ch. 3.1 - Suppose salary and deductions are variables of...Ch. 3.1 - Suppose speed and visibility are variables of type...Ch. 3.1 - Suppose salary and bonus are variables of type...Ch. 3.1 - Assume that nextWord is a string variable that has...Ch. 3.1 - Prob. 7STQCh. 3.1 - What output is produced by the following code? int...Ch. 3.1 - Suppose you change the code in the previous...Ch. 3.1 - What output is produced by the following code? int...
Ch. 3.2 - Suppose number is a variable of type int that has...Ch. 3.2 - What output is produced by the following...Ch. 3.2 - What output is produced by the following...Ch. 3.2 - What output is produced by the following...Ch. 3.3 - What output is produced by the following code?Ch. 3.3 - Suppose you change the code in the previous...Ch. 3.3 - What output is produced by the following code?Ch. 3.3 - What output is produced by the following code?Ch. 3.3 - Suppose you change the first line of the code in...Ch. 3.3 - Prob. 20STQCh. 3.4 - Prob. 21STQCh. 3.4 - Prob. 22STQCh. 3.4 - Write code for a JOptionPane dialog that will ask...Ch. 3 - Write a fragment of code that will test whether an...Ch. 3 - Write a fragment of code that will change the...Ch. 3 - Suppose you are writing a program that asks the...Ch. 3 - Prob. 4ECh. 3 - Consider the following fragment of code: What is...Ch. 3 - We would like to assess a service charge for...Ch. 3 - What is the value of each of the following boolean...Ch. 3 - The following code fragment will not compile. Why?...Ch. 3 - Prob. 9ECh. 3 - Consider the boolean expression (2 5) (x 100))....Ch. 3 - Write a switch statement to convert a letter grade...Ch. 3 - Consider the previous question, but include + or ...Ch. 3 - Imagine a program that displays a menu of five...Ch. 3 - Repeat the previous exercise, but define an...Ch. 3 - Repeat Exercise 13, but use a multibranch if-else...Ch. 3 - Given that the int variable temp contains a...Ch. 3 - Write Java statements that create a yes-or-no...Ch. 3 - A number x is divisible by y if the remainder...Ch. 3 - Write a program to read in three nonnegative...Ch. 3 - Write a program that reads three strings from the...Ch. 3 - Write a program that reads a one-line sentence as...Ch. 3 - Write a program that allows the user to convert a...Ch. 3 - Write a program that inputs an integer. If the...Ch. 3 - Prob. 7PCh. 3 - Repeat Programming Project 5 of Chapter 2, but...Ch. 3 - Repeat any of the previous Practice Programs using...Ch. 3 - Suppose that we are working for an online service...Ch. 3 - Write a program that reads a string from the...Ch. 3 - Repeat the calorie-counting program described in...Ch. 3 - Repeat Programming Project 5 but in addition ask...Ch. 3 - Repeat Programming Project 11 in Chapter 2, but if...Ch. 3 - Write a program to play the rock-paper-scissor...Ch. 3 - Prob. 9PPCh. 3 - Repeat Programming Project 8 in Chapter 1, but add...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
What is the difference between an object and a class?
Computer Science: An Overview (12th Edition)
Write a variable declaration for an Integer variable named intUnitsSold.
Starting Out With Visual Basic (8th Edition)
The spreadsheet in Microsoft Excel file Ch01Ex01_U10e.xlsx contains records of employee activity on special pro...
Using MIS (10th Edition)
Why is it necessary to introduce some methods and documentation from plan-based approaches when scaling agile m...
Software Engineering (10th Edition)
What is a symbol table?
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
What is the difference between a protected class member and a private class member?
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- If you reject H0 when H0 is correct, what type of error is this? Question 15 options: a Type I b Type II c No Errorarrow_forwardThe Dash Cell Phone Company charges customers a basic rate of $5 per month to send text messages. Additional rates are as follows: The first 100 messages per month, regardless of message length, are included in the basic bill. An additional three cents are charged for each text message after the 100th message, up to and including 300 messages. An additional two cents are charged for each text message after the 300th message. Federal, state, and local taxes add a total of 14 percent to each bill. Design a flowchart or pseudocode for the following: b. A program that continuously accepts data about text messages until a sentinel value is entered, and displays all the details.arrow_forwardThe Dash Cell Phone Company charges customers a basic rate of $5 per month to send text messages. Additional rates are as follows: The first 100 messages per month, regardless of message length, are included in the basic bill. An additional three cents are charged for each text message after the 100th message, up to and including 300 messages. An additional two cents are charged for each text message after the 300th message. Federal, state, and local taxes add a total of 14 percent to each bill. Design a flowchart or pseudocode for the following: e. A program that prompts the user for a three-digit area code from which to select bills. Then the program continuously accepts text message data until a sentinel value is entered, and displays data only for messages sent from the specified area code.arrow_forward
- The Dash Cell Phone Company charges customers a basic rate of $5 per month to send text messages. Additional rates are as follows: The first 100 messages per month, regardless of message length, are included in the basic bill. An additional three cents are charged for each text message after the 100th message, up to and including 300 messages. An additional two cents are charged for each text message after the 300th message. Federal, state, and local taxes add a total of 14 percent to each bill. Design a flowchart or pseudocode for the following:a. A program that accepts the following data about one customer's messages: area code (three digits), phone number (seven digits), and number of text messages sent. Display all the data, including the month-end bill both before and after taxes are added.b. A program that continuously accepts data about text messages until a sentinel value is entered, and displays all the details.c. A program that continuously accepts data about text messages…arrow_forwardThe Dash Cell Phone Company charges customers a basic rate of $5 per month to send text messages. Additional rates are as follows: The first 100 messages per month, regardless of message length, are included in the basic bill. An additional three cents are charged for each text message after the 100th message, up to and including 300 messages. An additional two cents are charged for each text message after the 300th message. Federal, state, and local taxes add a total of 14 percent to each bill. Design a flowchart or pseudocode for the following: d. A program that continuously accepts data about text messages until a sentinel value is entered, and displays details only about customers whose total bill with taxes is over $10.e. A program that prompts the user for a three-digit area code from which to select bills. Then the program continuously accepts text message data until a sentinel value is entered, and displays data only for messages sent from the specified area code.arrow_forwardThe Dash Cell Phone Company charges customers a basic rate of $5 per month to send text messages. Additional rates are as follows: The first 100 messages per month, regardless of message length, are included in the basic bill. An additional three cents are charged for each text message after the 100th message, up to and including 300 messages. An additional two cents are charged for each text message after the 300th message. Federal, state, and local taxes add a total of 14 percent to each bill. Design a flowchart and pseudocode for the following: A program that continuously accepts data about text messages until a sentinel value is entered, and displays details only about customers whose total bill with taxes is over $10.arrow_forward
- Hello, great work. A quick question - there is no boolean expression used anywhere in the script right ? If yes then please provide a boolean expression exempt code. If its not used then its fine.arrow_forwardManually trace the code fragment provided above. What string would be printed to the terminal if the character 'h' was provided as user input? This question is internally recognized as variant 241. Q16) 1-6-7-8- 0-2-5-6- 1-4-5-7-8- 0-3-4-8- 0-8- 4-5-7-8- 0-1-3-4- 1-2-4-5-6-8- none of the abovearrow_forwardCan provide a description outlining which option chosen and a description of how the code works and how to use it. Also can you fix the code. #Defining AND circuit def AND(a, b): #If both values are 1 return 1 if a == 1 and b == 1: return 1 else: #Otherwise return 0 return 0 #Defining OR circuit def OR(a, b): #If either of value is 1 return 1 if a + b == 1 or a == b == 1: return 1 else: #Otherwise return 0 return 0 #Defining NOT circuit def NOT(a): #If the input is 1 if a == 1: #Return 0 return 0 #If the input is 0 elif a == 0: #Return 1 return 1 #Defining NAND circuit def NAND(a, b): a = AND(a, b) if a == 1: return 0 else: return 1 #Defining NOR circuit def NOR(a, b): a = OR(a, b) if a == 1: return 0 else: return 1 #Defining XOR circuit def XOR(a, b): a = OR(AND(a, NOT(b)), AND(NOT(a), b)) if a == 1: return a else: return 0 #Defining NXOR circuit def…arrow_forward
- Write a tag that validates an input text for a double value with minimal 4.5 and maximum 19.9.arrow_forwardQuestions. 1. Break is required in the switch statement. A. True B. False 2. The expression of the right hand aide of || operators doesn't get evaluated if the left hand side determines the outcome. A. True B. False 3. If x is an integer varialble, which value will x = 5/2.0 yield? A. 2.5 B. 2.00000 C. 2 D. 0 4. The statement for (x=10; x + +) will result to an indefinite loop. A. True B. False 5. What is the final value of c when the code: for(x=1; x=arrow_forwardWhich of the following statement is true? A The default case is required in the switch selection statement. B The break statement is required in the last case of a switch selection statement. C The expression ( x > y && a < b ) is true if either x > y is true or a < b is true. D An expression containing the || operator is true if either or both of its operands is true. A form is defined by a (n) ____________ term? A form B Table C caption D prearrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Linux - Tutorial for Beginners in 13 MINUTES! [ UPDATED ]; Author: bai;https://www.youtube.com/watch?v=BMGixkvJ-6w;License: Standard YouTube License, CC-BY
What is Linux?; Author: Techquickie;https://www.youtube.com/watch?v=zA3vmx0GaO8;License: Standard YouTube License, CC-BY
Introduction to Linux and Basic Linux Commands for Beginners; Author: sakitech;https://www.youtube.com/watch?v=IVquJh3DXUA;License: Standard Youtube License