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
Alex
3 years ago
10

Write a C++ program using a do while loop for (Find the highest score). The program should work for any number of students. Run

the program for 3 cases:
Computers and Technology
1 answer:
alexdok [17]3 years ago
8 0

Answer:

  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.    int highest = 0;
  6.    int score;  
  7.    do{
  8.        cout<<"Input a score: ";
  9.        cin>>score;
  10.        
  11.        if(score > highest){
  12.            highest = score;
  13.        }    
  14.    }while(score >= 0);
  15.    
  16.    cout<<highest;
  17.    return 0;
  18. }

Explanation:

Firstly, create a variable highest and initialize it with zero (Line 5). Next, create a do while loop (Line 7 - 14). Within the loop prompt user to input a score (Line 8-9) and if the current score is higher than the highest variable, assign the score to highest variable (Line 11 - 13).

After finishing the loop when user put in any negative value, the program shall be able to print out the highest input score (Line 16).

You might be interested in
Yvonne found an article online that relates to her research topic, but the article does not cite the author. What should Yvonne
jonny [76]
Hey there!

If Yvonne found an article that relates to her research topic, but it doesn't cite an author, then she should definitely look up another article that relates to her topic that does cite the author. She shouldn't pretend that the article that cites no author is hers, otherwise she could possibly get her grades lowered.

Hope this helps you.
Have a great day! (:
3 0
3 years ago
Read 2 more answers
Your friend is an intern at the local Department of Health and needs to prepare a report about the recent activity of the influe
Butoxors [25]

Answer:

#include<bits/stdc++.h>

using namespace std;

int main(){

  // Defining Variables

  int no_of_weeks;

  int total_cases = 0;

  //Declaring Vector of Pair of Integer and string

  std::vector<pair<int,string>> data;

  // Taking Input for the Number of Weeks

  cout<<"Enter No. of Weeks\n";

  cin >> no_of_weeks;

  // Running the Loop for no_of_weeks times

  for(int i = 0; i < no_of_weeks ; i++){

      int A,B,C;

      // Taking Input for different types of flus

      cout<<"Enter No. of Cases of Flu A, B, C for week" << i + 1 << " seperated by space : \n";

      cin >> A >> B >>C;

      // Adding all the cases in a week

      int cases_in_a_week = A + B + C;

      // Updating total cases

      total_cases += cases_in_a_week;

      // Declaring the level variable

      string level;

      // Updating the level of the week corresponding to each case

      if(cases_in_a_week < 500) level = "Low";

      else if(cases_in_a_week >= 500 && cases_in_a_week < 2000) level = "Moderate";

      else level = "Widespread";

      // Storing the Week's information by using a vector of pairs

      // in which pair's first is the number of cases which is of type int

      // while the second is the level of the flu which is of the type string

      data.push_back(make_pair(cases_in_a_week,level));

  }

  // Linking the stdoutput to the flu_report.txt file

  // this also creates the file with the same name if it doesn't exists

  freopen("flu_report.txt", "w", stdout);

  // Printing the respective output data with Bar Chart of stars for each level

  for(int i = 0;i < no_of_weeks ; i++){

      //printing the week no. and number of cases

      cout<<i+1<<" "<<data[i].first<<" "<<data[i].second<<" |";

      //calculating the number of stars

      int stars = data[i].first/250;

      //printing the stars of the bar chart

      for(int j = 0; j < stars ; j++) cout<<"*";

      cout<<endl;

  }

  //printing the total number of cases

  cout<<total_cases;

}

Explanation:

3 0
3 years ago
Read 2 more answers
Sharon is a network engineer for your firm and is investigating the WAN connection into the hot site. In the event of operations
lisabon 2012 [21]

Answer:

The correct answer to the following question will be "Peak capacity" and "Bandwidth starvation".

Explanation:

Peak capacity has been used to characterize the gradient aqueous phase separation efficiency or performance. It represents the overall conceptual number of operations or components which can be isolated consistently with something like a given set of analytical circumstances and column with

⇒ Rs =1 (Figure 1 and Equation 1)

Certain traffic competing at its policies for the available or unused bandwidth will theoretically enable classes with lower value rates to starve to bandwidth.

Due to these activities, Sharon is concerned about "Bandwidth starvation" and "Peak capacity".

8 0
4 years ago
Assume the variable date has been set to a string value of the form mm/dd/yyyy, for example 09/08/2010. (Actual numbers would ap
bonufazy [111]

Answer:

String date = "21/05/2020";

String dayStr = date.substring(0,2);

int day = Integer.parseInt(dayStr);

System.out.println(day);

Explanation:

Create a variable called <em>date</em> which holds the current date

Create a variable called <em>dayStr</em>. Initialize it to the day part of the <em>date</em> using the substring method

Create a variable called <em>day</em>. Parse the <em>dayStr</em> and assign it to the <em>day</em>

Print the <em>day</em>

6 0
4 years ago
Which of these is not considered by economists to be a want?
KATRIN_1 [288]
Bowl of cereal these is not considered by economists
4 0
3 years ago
Other questions:
  • Which type of media would be best for showing global trade routes?
    7·2 answers
  • Privacy concerns, financial information, security of your personal data has
    14·1 answer
  • How many typefaces should you use in business documents?
    9·2 answers
  • How do you represent the decimal integer 50 in binary?
    14·1 answer
  • Write an expression using membership operators that prints "Special number" if special_num is one of the special numbers stored
    12·1 answer
  • Each professional association has
    7·1 answer
  • An F-1 ____________ may be authorized by the DSO to participate in a curricular practical training program that is an__________
    8·1 answer
  • How do i get around a school related block
    13·2 answers
  • Select the true statement about the motherboard.
    9·1 answer
  • Give two differences between ergonomic keyboard and standard keyboard?​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!