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
sveticcg [70]
3 years ago
11

write a loop that reads positive integers from standard input and that terminates when it reads an integers that is not positive

. After the loop terminates , it prints out separate by a space on a single line
Computers and Technology
1 answer:
rjkz [21]3 years ago
7 0
I found this loop. But it ends like this: After the loop terminates, <span>it prints out the sum of all the even integers read. Declare any variables that are needed.</span>

<span>int sum=0;
int num=1;
while(num > 0){
cin >> num;
if ((num % 2)==0 & (num>0)){
sum+=num;
}
}
cout << sum;

I'm not familiar with coding but I think you can work on this loop and edit it according to your requirement.</span>
You might be interested in
Jacob is preparing a presentation on the health and social advantages of taking up a sport at an early age. Most of the slides i
8090 [49]

Answer:

C. Make the slide image large so the charts can be seen clearly.

Explanation: Edg

8 0
2 years ago
A teacher has five students who have taken four tests. The teacher uses the following grading scale to assign a letter grade to
AlladinOne [14]

Answer:

#include <iostream>

using namespace std;

int main()

{

const int numofStudents = 5;//number of students

const int numofTests = 2;//number of tests taken by students

const int grade = 5;//number of grades available

char letter[grade] = { 'A','B','C','D','F' };

double table[numofStudents][numofTests];//defining 2darray with names and scores

string names[numofStudents];//storing names of students

for (int num = 0; num < numofStudents; num++)//storing names and scores of students

{

 cout << "Enter student's name: ";

 cin >> names[num];

 for (int test = 0; test < numofTests; test++)//scores loop

 {

  cout << "Enter the test score: ";

  cin >> table[num][test];

  if (table[num][test] < 0 || table[num][test]>100)//input validation

  {

   cout << "Invalid input. Try again" << endl;

   cin >> table[num][test];//input again

  }

 }

}

for (int i = 0;i < numofStudents;i++)//calculating averages and grades

{

 int sum = 0;

 cout << "Test scores for " << names[i] << ": " << endl;

 for (int j = 0;j < numofTests;j++)

 {

  cout << table[i][j] << " ";

  sum += table[i][j];//summing scores

 }

 cout << endl;

 float average = (float)sum / numofTests;//calculating the average

 cout << "Making an average of: "<< average;

 if (average <= 100 && average >= 90)//assigning a grade

 {

  cout << " and has received an " << letter[0];

 }

 else if (average <= 89 && average >= 80)

 {

  cout << " and has received a " << letter[1];

 }

 else if (average <= 79 && average >= 70)

 {

  cout << " and has received a " << letter[2];

 }

 else if (average <= 69 && average >= 60)

 {

  cout << " and has received a " << letter[3];

 }

 else if (average <= 59 && average >= 0)

 {

  cout << " and has received an " << letter[4];

 }

 else

 {

  cout << "Invalid scores entered." << endl;

 }

 cout << endl;

}

 return 0;

}

Explanation:

We first define the number of students, number of tests and number of grades available for assignments. We then fill in the 2D array of students names and their scores making sure assigning more than 100 and less than 0 is not allowed. We then sum the scores and retrieve an average. Using the average, a letter grade is assigned to that individual.

6 0
3 years ago
After you design and write your help-desk procedures to solve problems, what should you do next?
vichka [17]

<em>After you design and write your help-desk procedures to solver the problem, the next step would be, testing and implementation. </em>

<em> </em>

<em>Basically, in any problem-solving process, after planning and designing the solutions, the next process that should be implemented next is: testing and implementation. In the testing phase, staff and employees would implement the solution softly, meaning everything is not advertised yet and not formal yet. They would execute the plan and design and would evaluate if it is really effective. A documentation will prepare as the basis of the evaluation. After the testing, the project team would determine if the offered solution is possible or if there are more improvements to make.</em>

7 0
4 years ago
When is cookies Useful or Inappropriate
Kisachek [45]

PUT THAT COOKIE DOWN!!!!!

5 0
3 years ago
Read 2 more answers
You have the opportunity to meet some droids and Wookies! Prompt the user for their name, then how many droids, and then how man
Artist 52 [7]

name = input("What's your name? ")

droids = int(input("How many droids do you want to meet? "))

wookies = int(input("How many wookies do you want to meet? "))

print(name + " wants to meet "+str(droids)+" droids and "+str(wookies)+" Wookies.")

I wrote my code in python 3.8. I hope this helps!

7 0
3 years ago
Other questions:
  • Which internet technology allows businesses to make presentations and share visual aids such as charts and graphs ?
    7·2 answers
  • A ____ is any key that uniquely identifies each row.
    15·1 answer
  • On the seventh day of the iteration, the team realizes that they will not complete 5 of the 13 stories. the product owner says s
    12·1 answer
  • Subana is writing a program which will calculate the mean average of a set of numbers by adding the numbers and dividing the res
    11·2 answers
  • A _____ is a valuable tool that enables a user to find information on the Web by specifying words or phrases known as keywords,
    10·2 answers
  • The picture that graphically represents the items you use in Windows is called a/an <br> ___?
    14·1 answer
  • White lines
    7·2 answers
  • Label provides the code that executes if no case label is matched ​
    6·1 answer
  • What is the function of HTML?
    6·2 answers
  • Which of these statements performs real number quotient division using type casting?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!