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
Genrish500 [490]
3 years ago
13

Write a do-while loop that asks the user to enter two numbers. The numbers should be added and the sum displayed. The user shoul

d be asked if he or she wishes to per- form the operation again. If so, the loop should repeat; otherwise it should terminate.
Computers and Technology
1 answer:
iVinArrow [24]3 years ago
5 0

The do-while loop for the given problem is shown below.  

do  

{  

  // user asked to enter two numbers  

  cout<<"Enter two numbers to be added."<<endl;  

  cin>>num1;  

  cin>>num2;  

  sum = num1 + num2;  

 

  // sum of the numbers is displayed  

  cout<<"Sum of the two numbers is "<<sum<<endl;  

  // user asked whether to perform the operation again  

  cout<<"Do you wish to continue (y/n) ?"<<endl;  

   cin>>choice;  

}while(choice != 'n');  

The variables to hold the two numbers and their sum are declared as float so that the program should work well for both integers and floating numbers.

float num1, num2, sum;

The char variable is taken since it holds only a single-character input from the user, 'y' or 'n'.

char choice;

The whole program is given below.

#include <iostream>

using namespace std;

int main() {

float num1, num2, sum;

char choice;  

do  

{  

  // user asked to enter two numbers  

  cout<<"Enter two numbers to be added."<<endl;  

  cin>>num1;  

  cin>>num2;  

  sum = num1 + num2;  

  // sum of the numbers is displayed  

  cout<<"Sum of the two numbers is "<<sum<<endl;  

  // user asked whether to perform the operation again  

  cout<<"Do you wish to continue (y/n) ?"<<endl;  

  cin>>choice;  

}while(choice != 'n');

cout<<"Quitting..."<<endl;

}

You might be interested in
How to share excel file for multiple users office 365?.
Sholpan [36]

Answer:

You would need that person email to share it with them.

5 0
2 years ago
Read 2 more answers
Lian's dad uses an interactive machine that allows him
klemol [59]

Answer:

introduction to robotics

Explanation:

just took the test

4 0
3 years ago
Read 2 more answers
I will mark brainalist! ​
netineya [11]

Answer:

I would say

1) Weather Station

2) (word missing)

3) Robot perihen devices

4) Bit

5) Primary Key

6) Algorithim

7) Flow Chart

8) Table Wizard

9) Design View

10) SIMS

5 0
4 years ago
which type of encoding involves relating new information to existing knowledge that you already have stored in long-term memory?
rjkz [21]

A type of encoding that involves relating new information to existing knowledge that you already have stored in long-term memory is: Semantic encoding.

Encoding can be defined as a communication process in which the sender of a message transforms an information into an encrypted message, in the form of notable symbols that represent ideas or concepts.

Generally, a message that has been encoded by a sender requires a decoding action by the recipient, in order for the communication process to be complete.

Semantic encoding is a type of encoding which typically involves the relation of new information with respect to an existing knowledge that has been stored in long-term memory.

In conclusion, semantic encoding deals with the encoding of meaning from new information rather than perceptual characteristics such as the meaning of words in English language.

Read more: brainly.com/question/24113575

7 0
3 years ago
What type of file system is used by blu-ray discs?
soldi70 [24.7K]

Answer:

Universal disc format (UDF) file system.

Explanation:

Blue-ray discs are the optical disc for data storage in a digital format. They were designed as succession of DVDs. They use UDF file system in them.

  • UDF file system is used in blu-ray discs.
  • This system is used to store data on discs by burning media.
  • These files have the extension (.UDF)
  • UDF is mostly used in DVDs and optical discs.
  • Broad range of data is stored in computer storage using UDF.
8 0
3 years ago
Other questions:
  • Attention merchants define
    5·1 answer
  • Where do you go to create a workbook?​
    8·1 answer
  • teve wants to use Google Display Ads to reach new customers who are looking to purchase products similar to his. Which audience
    14·1 answer
  • Formulate it as a tree search problem.
    15·1 answer
  • A Hospital wants to store different types of data I need to find the best storage device for each type and why what is the best
    14·1 answer
  • What is the difference between Packaged and tailored soft ware?​
    6·1 answer
  • You are having difficulty changing permissions for a folder on an NTFS volume that was created by another user. How can you best
    6·1 answer
  • Which of these parts of a computer produces an observable result?
    11·2 answers
  • Analyze the given word pattern and choose the correct option.
    12·1 answer
  • The analysis of attempting to solve a problem with information systems is called ________.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!