Give a variable whose value is a letter grade

Assignment Help Computer Engineering
Reference no: EM1328954

1. Write a conditional that assigns true ( 1 ) to the variable fever if the variable temperature is greater than 98.6 .

2. Write a conditional that assigns 10,000 to the variable bonus if the value of the variable goodsSold is greater than 500,000 .

3. Write an if/else statement that compares the double variable pH with 7.0 and makes the following assignments to the int variables neutral , base , and acid :
0, 0, 1 if pH is less than 7
0, 1, 0 if pH is greater than 7
1, 0, 0 if pH is equal to 7.

4. Write an if/else statement that adds 1 to the variable minors if the variable age is less than 18 , adds 1 to the variable adults if age is 18 through 64 , and adds 1 to the variable seniors if age is 65 or older.

5. Given the integer variables x and y , write a fragment of code that assigns the larger of x and y to another integer variable max .

Assume that grade is a variable whose value is a letter grade-- any one of the following letters: 'A', 'B', 'C', 'D', 'E', 'F', 'W', 'I'. Assume further that there are the following int variables, declared and already initialized: acount, bcount, ccount, dcount, ecount, fcount, wcount, icount.

Write a switch statement that increments the appropriate variable (acount, bcount, ccount, etc.) depending on the value of grade. So if grade is 'A' then acount is incremented; if grade is'B' then bcount is incremented, and so on.

6. Write a switch statement that tests the value of the char variable response and performs the following actions:
if response is y , the message Your request is being processed is printed

if response is n , the message Thank you anyway for your consideration is printed

if response is h , the message Sorry, no help is currently available is printed for any other value of response , the message Invalid entry; please try again is printed

7. Write an if/else statement that compares the value of the variables soldYesterday and soldToday , and based upon that comparison, assigns salesTrend the value -1 or 1 .

-1 represents the case where soldYesterday is greater than soldToday ; 1 represents the case where soldYesterday is not greater than soldToday .

Reference no: EM1328954

Questions Cloud

A strategic vision statement for a digital camera company : Need a strategic vision statement for a digital camera company serving 4 regions North America, Europe-Africa, Asia-Pacific, and Latin America.
What do you know about operator precedence : what do you know about operator precedence.
Industry in a monopolistically competitive industry : The demand curve faced by a industry in a monopolistically competitive industry which is more elastic than the perfectly competitive firm's demand curve.
Relationship between business vision and business strategy : Explain the relationship between business vision and business strategy?
Give a variable whose value is a letter grade : suppose that grade is a variable whose value is a letter grade-- any one of the following letters: 'A', 'B', 'C', 'D', 'E', 'F', 'W', 'I'. Assume further that there are the following int variables, declared and already initialized: acount, bcount,..
Describe the concept of time value of money : Explain the concept of Time Value of Money (TVM). What are its components? why is it a foundational principle of finance?
Implement to meet the mandate from management : We are developing a program for a group experience Supply Chain Managers and have drafted the questions below which we will include as a part of the program. Please assist by providing detailed responses to the following questions along with citat..
Explain this affect the elasticity of demand for gasoline : Explain how would this affect the elasticity of demand for gasoline
The possible strategies to ensure change sustenance : What are the possible strategies to ensure change sustenance.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Formal mission statement about soft-wear, limited

Explain how do the information systems help the people working individually and in groups make the decisions more efficiently? Write down a formal mission statement about the Soft-Wear, Limited (SWL).

  What range of distances does bernie have a higher data rate

The dog can travel to your side, wherever you may be, at 18 km/hour. For what range of distances does Bernie have a higher data rate than a transmission line whose data rate (excluding overhead) is 150 Mbps.

  Developing the website-based sales system

Consider that you have been hired in order to develop the website-based sales system for the large international retail sales firm.

  How important is it to keep the site current

How important is it to keep the site current.According to "Putting Business Online Isn't Always Easy" (2005), "the biggest mistake people make is failing to know the commitment a Web site demands."

  The advantages and disadvantages of using functions

Show how you might write the "case" statement using only the "if" statement in its place an actual case statement. Hint: Nested if statements. Explain your code.

  Controlling congestion in error-free virtual circuit subnet.

Consider the following method for congestion control in the error-free virtual circuit subnet. A router may only transmit ACK for a received packet if it knows packet transmission along with the virtual circuit through subsequent routers is succes..

  Determining the priority of period of execution of irqj

Determining the priority of period of execution of IRQJ

  Program to input the phone numbers

Write down a program which prompts the user to enter a telephone number expressed in the letters and outputs corresponding telephone number in digits.

  Difference between clustered and nonclustered indexes

define the meaning of each of the transaction levels supported by SQL Server.

  Describing the lcg

Provide the value of a? Specify the restrictions that are required on the seed?

  How to produce a work breakdown structure

How to produce a Work Breakdown Structure. Ensure main WBS tasks headings are the 5 PMBOK® process areas.

  How to write a program that allows the user to enter student

how to Write a program that allows the user to enter student names followed by their test scores and output the following information.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd