Write a switch statement to convert a letter grade into an equivalent numeric value on a fourpoint
Question:
Write a switch statement to convert a letter grade into an equivalent numeric value on a fourpoint 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.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 76% (13 reviews)
switchletter case A gradeValue 40 break case ...View the full answer
Answered By
Susan Juma
I'm available and reachable 24/7. I have high experience in helping students with their assignments, proposals, and dissertations. Most importantly, I'm a professional accountant and I can handle all kinds of accounting and finance problems.
4.40+
15+ Reviews
45+ Question Solved
Related Book For
Java An Introduction To Problem Solving And Programming
ISBN: 9780134462035
8th Edition
Authors: Walter Savitch
Question Posted:
Students also viewed these Computer science questions
-
Repeat the previous exercise, but define an enumeration and use it within the switch statement. Previous exercise Imagine a program that displays a menu of five possible choices, lettered a through...
-
a) The use of computers in education is referred to as computer-assisted instruction (CAI). Write a program that will help an elementary school student learn multiplication. Use the rand function to...
-
Imagine a program that displays a menu of five possible choices, lettered a through e. Suppose the users selection is read into the character variable choice. Write a switch statement that reacts to...
-
While you may not work for a large corporation, there is merit to the notion that the organization must speak with one voice and speak quickly in a crisis. What forces (tradition, practice, and...
-
Methane (CH4) is burned in the presence of diatomic oxygen. The combustion products consist of water vapor and carbon dioxide gas. Determine the mass of water vapor generated when 1 lbm of methane is...
-
Corwin Lewis, the manager of a fishery, determines that t days after 1,000 fish of a particular species are released into a pond, the average weight of an individual fish will be w(t) pounds and the...
-
Under what circumstances should a healthcare professional self-insure?
-
1. What target market does Embrace seek to serve and how attractive is that market? 2. What examples of primary research that Embraces founders completed appear in the case? 3. What actions did...
-
Find the units digit of 329 +1112 +15. modulus n, an
-
1. If the laws are strict in one country, but lax in another country, do cruise ship companies have an ethical obligation to follow the stricter laws even when they are temporarily sailing through...
-
The following flowchart contains a series of questions to determine what kind of haircut to get. Write a program that asks the questions to the user and outputs the recommended haircut based on the...
-
Consider the previous question, but include + or letter grades. A+ is 4.25, A is 3.75, B+ is 3.25, B is 2.75, and so on. a. Why cant we use one switch statement with no other conditionals to convert...
-
At an activity level of 6,000 units the cost for maintenance is $7,200 and at 10,000 units the cost for maintenance is $11,600. Using the high-low method, the cost formula for maintenance is: a....
-
You have just been hired as the bookkeeper for Roll With It, a food truck and catering company. During the month of November, the following transactions occurred: purchase for cash from Freshly...
-
Elijah wants to learn how to fly planes but wants to spend less than $4,000 on lessons. Flight lessons cost $160 per hour in addition to a base rate of $120 to rent a plane. Show the inequalities...
-
When using context to infer the meaning of a word, you can look for: a. All of the answer choices b. Definitions of key terms in the text c. Antonyms of the word d. Synonyms of the word e. Lists that...
-
Tony and Maria each chose a positive integer and told these to Lenny, but to nobody else. Lenny said: "Either the sum of your two numbers is 70 or the product of your two numbers is 70." (Because...
-
Consider the ordinary differential equation dy +xy = 1 da with y(1)-1, and y(2) = 3.
-
The following data were randomly drawn from two independent populations. a. Specify the competing hypotheses to determine whether the median of Population 1 is greater than the median of Population...
-
Consider the advantages and disadvantages of extending property rights so that everyone would have the right to prevent people imposing any costs on them whatsoever (or charging them to do so).
-
To support multiple virtual machines, two levels of memory virtualization are needed. Each virtual machine still controls the mapping of virtual address (VA) to physical address (PA), while the...
-
One of the biggest impediments to widespread use of virtual machines is the performance overhead incurred by running a virtual machine. Listed below are various performance parameters and application...
-
In this exercise, we will explore the control unit for a cache controller for a processor with a write buffer. Use the finite state machine found in Figure 5.40 as a starting point for designing your...
-
b. Using the inference rules show that S can be inferred if the following logical sentences are believed. 1. P 2. ZvH 3. Hv-P 5. H K 6. K (Sv-P) 7. (Z^-H)K 4. Sv(K) 8. (KA-Q) S Give your answer in...
-
1) Write a "C" program, which finds only a path (not all the paths) between two given cities according to the directed graph below. This program also calculates the distance between given these two...
-
How does MariaDB leverage optimizer enhancements such as Cost-Based Optimization (CBO), Index Condition Pushdown (ICP), and Histogram-Based Statistics to improve query execution efficiency and plan...
Study smarter with the SolutionInn App