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
Gelneren [198K]
4 years ago
12

Consider the following statements. If the input is 95, the output of the following code will be: #include #include using namespa

ce std; int main () { float score; string grade; cin >> score; grade = "Unknown"; if (score >= 90) grade = "A"; if (score >= 80) grade = "B"; if (score >= 70) grade = "C"; else grade = "F"; cout << grade; }
Computers and Technology
1 answer:
kenny6666 [7]4 years ago
8 0

Answer:

The output will be "C"; without the quotes

Explanation:

Given

The program above

Required

What will be the output if user input is 95

The output will be 95;

<em>Analysis</em>

1. Initially, grade = "Unknown"

grade = "Unknown";

2. Because user input is greater than 90, grade changes its value from "Unknown" to: grade = "A"

if (score >= 90)

grade = "A";

2. Because user input is greater than 80, grade changes its value from "A" to: grade = "B"

if (score >= 80)

grade = "B";

3. Because user input is greater than 70, grade changes its value from "B" to: grade = "C"

if (score >= 70)

grade = "C";

4. This will not be executed because it specifies that if user input is less than 70; Since, this statement is false; the value of grade is still "C"

else grade = "F";

5. The value of grade is printed

cout << grade;

You might be interested in
1.
kenny6666 [7]
1. true
2. false
3. true
4. true
5. true

if you would like an elaboration, let me know 
8 0
3 years ago
When a field is declared static there will be ________. Group of answer choices two reference copies of the field for each metho
anygoal [31]

Answer: one field copy gets generated in memory

Explanation:

When a field is declared static,it will become common for entire class instances. Single copy of field that gets created for the particular class where numerous instances present in that class can use it by sharing .

  • Other options are incorrect because  two copy of reference does not gets created as it only supports single copy.
  • Copy of the field for every class is not generated by static field.All method and instances use  only one field copy for the whole class.
  • Thus the correct answer is creation of only one field copy in memory for static field.

7 0
3 years ago
Question 1
PolarNik [594]

Answer:

she is running a maintenance to make sure everything works

6 0
3 years ago
Unchecked exceptions require you surround the code that might throw such an exception with a try block or you must use a throws
hammer [34]

Answer:

b. False

Explanation:

False, unchecked exceptions do not cause compilation errors and do not require try/catch blocks or throws statements. However, although they are not required it is good programming to include them in order to handle any exceptions that may arise. If you do not include a proper way to handle such an exception the program will still run but may run into an exception during runtime. If this occurs then the entire program will crash because it does not know how to handle the exception since you did not provide instructions for such a scenario.

6 0
3 years ago
Assume the existence of a class named window with functions named close and freeresources, both of which accept no parameters an
denis-greek [22]
In your question whereas there is a class named window and it would be like this:

class window {
//code here 
}

Next is there is a function called close and freeresource and it goes like this:

class window{
  function close( ){
   //code here
  }
  function freeresource( ){
  // code here
  }
 public destruct (){
this.close();
this.freeresource();
}

}
The last code function destruct invokes the function close and freeresource. Hope this would help 

7 0
3 years ago
Other questions:
  • Dani wants to create a web page to document her travel adventures. Which coding language should she use? HTML Java Python Text
    15·1 answer
  • According to the video, who is the most common employer for Foresters?
    14·2 answers
  • A résumé can be delivered through _____.a.
    9·2 answers
  • Implement the function is_maxheap which takes a list of integers and returns True if the list represents a valid max-heap, and F
    6·1 answer
  • Angle parking spaces are generally entered at an angle about __________ from the curb.
    8·2 answers
  • Any part of the computer that you plug into the CPU like a phone, tablet, headphones etc. are called
    5·1 answer
  • The <br> is an image at the top of the page that includes the title.
    14·1 answer
  • What is the difference between the dom api and the html dom api.
    8·1 answer
  • unlike tv or newspaper ads, internet communications are interactive, and consumers can choose which messages and information the
    5·1 answer
  • What is the address space of a computer with a 64-bit address bus?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!