1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
vesna_86 [32]
3 years ago
9

assume that grade is a variable whose value is a letter grade-- anyone of the following letters: 'A', 'B', 'C', 'D', 'E', 'F', '

W', 'I'. Assume further there are the following int variables, declared an already initialized: account, bcount, ccount, dcount, ecount, fcount, wcount, icount. Write a switch statement that increments the apropiate 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.
Computers and Technology
1 answer:
eimsori [14]3 years ago
5 0

Answer:

Following are the Switch statement in C language is given below:

switch (grade)  //switch case

{

case 'A':  // case A

++acount; // incremented of acount

break;  // break the switch case

case 'B':  // case B

++bcount;  // incremented of bcount

break; // break the switch case

case 'C':  // case C

++ccount; // incremented of ccount

break; // break the switch case

case 'D':  //case D

++dcount; // incremented of dcount

break; // break the switch case

case 'E': //case E

++ecount;  // incremented of ecount

break;  // break the switch case

case 'F':  // case F

++fcount; // incremented of fcount

break;   // break the switch case

case 'W': // case W

++wcount;// increment of wcount

break; // break the switch case

case 'I': // Case

icount++;  // increment of icount variable

break;  // break the switch case

default: // default case

printf(" incorrect letter");/

}

Explanation:

The switch is used when we have multiple conditions and we have chosen only one condition.

The description of the statement is given below

  • In the switch condition, we have passed the char "grade" variable i.e switch(grade).
  • Inside the Switch case block, we have Created the cases 'A'.In Case A we have incremented the value of "acount " variable and break the case. The Same step is followed to create the case of B', 'C', 'D', 'E', 'F', 'W', 'I' respectively.
  • Suppose If the user Read character 'C' then control moves to the case 'C' . In that case, it firstly increments the value of "ccount" and break the switch case. The break statement is used for breaking the switch when a particular case is matched.
  • If the user Read incorrect character which is not matched with the cases than control moves to the default state and print "incorrect letter

You might be interested in
Write an expression that executes the loop while the user enters a number greater than or equal to 0.
LekaFEV [45]

Answer:

while (userNum >=0) {...}

Explanation:

In a <u>while loop</u>, <u>the loop is executed until the condition is false</u>.

Since the loop will execute while the user enters a number greater than or equal to 0 (and that number is declared as <em>userNum</em>), we need to check if <em>userNum</em> is greater than or equal to 0.

4 0
3 years ago
The ---------------initiates a message by encoding theidea (or a thought) in words or symbols and sends it to areceiver.ChannelS
saw5 [17]

Answer:

None of the given options

Explanation:

The sender initiates a message by encoding theidea (or a thought) in words or symbols and sends it to a receiver.

8 0
3 years ago
An insurance company utilizes SAP HANA for its day-to-day ERP operations. Since they can’t migrate this database due to customer
hichkok12 [17]

Answer: An Internet-routable IP address (static) of the customer gateway's external interface for the on-premises network

Explanation:

Based on the information given, an Internet-routable IP address (static) of the customer gateway's external interface for the on-premises network need to be configured outside of the VPC for them to have a successful site-to-site VPN connection.

The Internet-routable IP address will be used in the identificatiob of each computer through the use of the Internet Protocol for the communication over a network.

3 0
3 years ago
MODS ONLY answer this, I have something for you. I'm reporting this to make it easier
aliya0001 [1]

Answer:

whyyyyy

have  a good day :)

Explanation:

7 0
3 years ago
Is the app scener safe? its a chrome webstore app on computer.​
Sophie [7]

Answer:

Maybe

Explanation:

If you are unsure if a website is safe look for signs. If its asking you to allow advertisement then no. I suggest you download a VPN before going to the website just to be safe

5 0
3 years ago
Other questions:
  • Assume that the classes listed in the Java Quick Reference have been imported where appropriate.
    14·1 answer
  • In a right triangle, the square of the length of one side is equal to the sum of the squares of the lengths of the other two sid
    10·1 answer
  • Random-access memory (RAM) is able to quickly access data because it is arranged in which of the following configurations?
    8·2 answers
  • In a bubble sort, you use a(n) ____ loop to make pair comparisons.
    5·1 answer
  • How can multiple items be selected at the same time in aJList?
    8·1 answer
  • You are running out of storage space on one of your servers. you need to purchase an external hard drive, as there are no drive
    8·2 answers
  • Write is an I.P.O cycle? Describe with figure​
    5·1 answer
  • The Arizona Department of Transportation has offices throughout the state. State documents are stored on a large server in a cen
    5·2 answers
  • Write the features of Mark-I.​
    7·1 answer
  • Can someone help me with python
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!