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 plus MyProgrammingLab with Pearson eText -- Access Card Package (7th Edition)
Additional Engineering Textbook Solutions
Computer Science: An Overview (12th Edition)
Starting Out With Visual Basic (8th Edition)
Using MIS (10th Edition)
Software Engineering (10th Edition)
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
Starting Out with Java: From Control Structures through Data Structures (4th Edition) (What's New in Computer Science)
- 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
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage