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
Softa [21]
3 years ago
11

Write an expression that executes the loop body as long as the user enters a non-negative number.Note: If the submitted code has

an infinite loop, the system will stop running the code after a few seconds and report "Program end never reached." The system doesn't print the test case that caused the reported message.Sample outputs with inputs: 9 5 2 -1BodyBodyBodyDone.

Computers and Technology
1 answer:
Eva8 [605]3 years ago
5 0

Answer:

See attached picture.

Explanation:

See attached picture for explanation.

You might be interested in
Distinguish between a computer drive and computer driver​
rewona [7]

Answer:

The word Drive typically refers to a mechanical hard drive or solid-state hard drive used to store the OS, data and programs. A driver is software code that interfaces the various devices in the computer with the processing system.

Explanation:

..............................................................

6 0
2 years ago
How to write a C++ program that allows a user to enter their rating of the three movies in the Dark Knight Trilogy and then disp
8_murik_8 [283]

The program is an illustration of arrays.

Arrays are used to hold multiple values in one variable.

The program in C++ where comments are used to explain each line is as follows:

#include <iostream>

using namespace std;

int main(){

   //This declares an array of three elements for the three ratings

   int ratings[3];

   //This initializes the sum of the ratings to 0

   int total = 0;

   //The following iteration gets input for the three ratings

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

       cin>>ratings[i];

       //This calculates the sum of all inputs

       total+=ratings[i];

   }

   //This declares and initializes the lowest and the highest ratings

   int lowest = ratings[0], highest = ratings[0];

   //This iterates through the array

   for(int i = 1; i<3;i++){

       //The following if condition determines the lowest rating

       if (lowest > ratings[i]){    lowest = ratings[i];        }

       //The following if condition determines the highest rating

       if (highest < ratings[i]){            highest = ratings[i];        }

   }

   //This prints the output header

   cout<<"The ratings are: ";

   //The following iteration prints the three ratings

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

       cout<<ratings[i]<<" ";   }

   //The prints the highest ratings

cout<<endl<<"Highest: "<<highest<<endl;

   //The prints the lowest rating

   cout<<"Lowest: "<<lowest<<endl;

   //The prints the average rating

cout<<"Average: "<<total/3<<endl;

   return 0;

}

At the end of the program, the ratings entered, the highest rating, the lowest rating, and the average of the ratings are printed.

See attachment for sample run

Read more about similar programs at:

brainly.com/question/13261254

8 0
2 years ago
What is stored in alpha after the following code executes?
Andreas93 [3]

Answer:

3. alpha = {1, 5, 6, 7, 5}

Explanation:

Initially, we have that:

alpha[0] = 1;

alpha[1] = 2;

alpha[2] = 3;

alpha[3] = 4;

alpha[4] = 5;

For j higher than 2, we have that:

alpha[j - 1] = alpha[j] + 2;

So

j = 3

a[2] = alpha[3]+2 = 4 + 2 = 6;

j = 4

a[3] = alpha[4]+2 = 5+2 = 7;

The correct answer is:

3. alpha = {1, 5, 6, 7, 5}

6 0
3 years ago
"So far this month you have achieved $100.00 in sales, which is 50% of your total monthly goal. With only 5 more workdays this m
Rus_ich [418]

Answer:

$20 per day for next 5 working days.

Explanation:

if 50% is $100.00 another $100 need to achieve in 5 days.

100/5=20

3 0
3 years ago
Read 2 more answers
Why do employers prefer to hire people with more work ethic?
Andrej [43]

The importance of a good work ethic in school and life. Your good work ethic tells future employers what they might expect from you on the job.

4 0
3 years ago
Other questions:
  • you where discussing software piracy with a friend and were surprised to learn how software piracy can impact your life every da
    12·1 answer
  • You are evaluating the bounce rate of your overall website traffic and find that users with a social media referral source have
    9·1 answer
  • There are a few simple rules that you can follow to store and manage files and folders in your computer. What is the most import
    9·2 answers
  • Constructors have the same name as the ____.1. data members2. member methods3. class4. package
    5·1 answer
  • How we can get NET I'D by IP Address?
    11·1 answer
  • Computers that are close to one another are connected to form a LAN
    7·1 answer
  • Vicky is investigating multiple hacking attempts on her cloud-based e-commerce web servers. She wants to add a front-end securit
    5·1 answer
  • What invention in the past do you think had a significant impact on our culture/ lifestyle? What do you think will be invented/
    11·1 answer
  • What is the console.log function for?​
    13·1 answer
  • Write a q basic program to find the sum of all the even numbers from 1 to 50​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!