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
kogti [31]
3 years ago
5

. Write an if/else statement that assign "Excellent" to variable comments (a string data type) when score is 90 or higher, "Good

" when score is between 80 and 89, and "Try Harder" when score is less than 80.
Computers and Technology
1 answer:
LekaFEV [45]3 years ago
7 0

Answer:

Following are the program in c++

if(score>= 90)

 // check if score 90 or higher

{

comments = "Excellent"; // initialize comments to excellent

}

else if(score<90 && score >= 80)

// check if  when score is between 80 and 89

{

comments = "Good";   //initialize comments to good

}

else

//when score is less than 80.

{

comments = "Try Harder"; //initialize comments to try harder

}

Explanation:

Following are the program in c++ language

#include<iostream> // header file

using namespace std;  // namespace

int main() // main function

{

string comments; // variable

int score;  // variable declaration

cout<<" enter score ";

cin>>score;

if(score>= 90)

{

comments = "Excellent"; // initialize comments to execellent

}

else if(score<90 && score >= 80)

{

comments = "Good";   //initialize comments to good

}

else

{

comments = "Try Harder"; //initialize comments to try harder

}

cout<<comments;

return(0);

}

Output:

enter score

45

Try Harder

In this we check the condition  

if score>= 90 then it store the Excellent in variable  comments of type string

if(score<90 && score >= 80)

it store the Good in variable comments of type string.

otherwise it store harder in variable comments of type string.

You might be interested in
Which of the following tags contains metadata about the webpage?
Andre45 [30]
I cannot see the options but I am guessing that it is just regular HTML

If that is the case the <meta></meta> tag can be used and should be placed within the <head></head> tag
8 0
4 years ago
Read 2 more answers
Rectangle perimeter is 72 .Find the new perimeter if length is doubled and breadth is tripled​
777dan777 [17]

Answer:

Is it related to technology and computers?

3 0
3 years ago
Your ghost hunting group is recording the sound inside a haunted Stanford classroom for 20 hours as MP3 audio files. About how m
Mademuasel [1]

Answer:

1.152 GB if it will be at 128 kbps quality

Explanation:

So, let's say you choose your mp3 be 128 kbps (kilobits per second).

One byte is 8 bits. So 128 kbps = 16 kilobytes per second.

There is 60*60 seconds in one hour. So 16*60*60 = 57.6 megabytes per hour

Multiply by 20 hours to get your answer: 57.6*20 = 1152 MB = 1.152 GB.

3 0
3 years ago
Error: At least one of the class levels is not a valid R variable name; This will cause errors when class probabilities are gene
qwelly [4]

Using the knowledge in computational language in JAVA it is possible to write a code that use factor levels that can be used as valid R variable names

<h3>Writting the code in JAVA:</h3>

<em>    method  = "repeatedcv"</em>

<em>  , number  = 10</em>

<em>  , repeats = 1 </em>

<em>  , verboseIter = TRUE</em>

<em>  , summaryFunction  = fivestats</em>

<em>  , classProbs = TRUE</em>

<em>  , allowParallel = TRUE)</em>

<em />

<em />

See more about JAVA at brainly.com/question/12975450

#SPJ1

3 0
2 years ago
Can someone tell me how to mark people the brainiest on a laptop?
Crazy boy [7]

When two people give answer to your question, then below their answer you will get a option Mark as Brainliest. You simply need to click that button

7 0
3 years ago
Other questions:
  • What is the magnitude of the largest positive value you can place in a bool? a char? an int? a float?
    14·1 answer
  • Airbags only absorb the _____ impact in a crash. initial final mid-stage smallest
    13·1 answer
  • Sam has sent Sally an email. Sally wants to answer him without manually typing in his email address. Which email option should s
    12·2 answers
  • Which of the following describes an acceptable print resolution?
    7·1 answer
  • WHAT DOES THE TRANSPORT LAYER USE TO MAKE SURE THAT A MESSAGE IS REASSWMBLED CORRECTLY ON THE RECEIVING DEVICES?
    6·1 answer
  • Write a function listLengthOfAllWords which takes in an array of words (strings), and returns an array of numbers representing t
    14·1 answer
  • Why does the job market change overtime
    9·1 answer
  • Write the definition of a method named countPos that receives a reference to a Scanner object associated with a stream of input
    13·1 answer
  • Suppose you are among those who believe that the NLRA should be transformed. What arguments support the claim that a complete ov
    6·1 answer
  • PLEASE HELP THIS IS CONFUSING ME
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!