2. Design a Do-While loop that asks the user to enter two numbers. The numbers should be added and the sum displayed. The loop should ask the user whether he or she wishes to perform the operation again. If so, the loop should repeat; otherwise it should terminate.

Answers

Answer 1

#include <iostream>

#include <string>

main ()

{

   using std::cout;

   using std::cin;

   std::string s;

   do

   {

      cout<<"Type 2 numbers: ";

      int a,b;

      cin>>a>>b;

      cout<<"Sum of your numbers equals to: "<<a+b;

      cout<<"\nType \"Yes\" if you want to continue.";

      cin>>s;

   }while(s=="Yes");

   return 0;

}

Answer 2

Answer:

Program :

#include <iostream> // Header file.

using namespace std;

int main () // Main function which starts the executions

{

   int First_Number,Second_Number; // variable declaration.

   char choice; // Variable declaration.

   do // do while loop

   {

        cout<<"Enter two number for addition"; // user instruction

        cin>>First_Number>>Second_Number; // take a input

        cout<<"The adition of "<<First_Number<<" and "<<Second_Number<<" is: "<<First_Number+Second_Number; //Addition will print

        cout<<"\nType \"Y\" for continue the operation again otherwise press any key"; // User message for choice.

        cin>>choice; // input for choice.

   }

   while(choice=='Y'||choice=='y'); // condition for Do-While loop

   return 0; // return statement.

}

Output:

If the user input are 4,5 and u then the output is 9If the user input are 5,6 and y and 7,8 and u then the output are 11, 15.

Explanation:

The above code is in C++ language.The above program firstly renders a message to enter the two numbers.Then it performs addition operation and then the result will be printed.Then it renders a message for the user choice.If the user enters capital y or small y, then the above operation will continue again.Otherwise, the program will be terminated.

Related Questions

Ethernet is a standard for a) LAN b) MAN c) WAN d) All of the above

Answers

Answer:

a) LAN

Explanation:

Ethernet is a standard for a IEEE or LAN.

Answer:all of the above

Explanation:

What number in base 2 is equivalent to 823 in base 10

Answers

823 in base 2 divide 823 by 2 and start writing remainder and then read remainders in reverse to get equivalant of 823 in base 10 to base 2 823 2 gt rem 1 now question of 8232 is 411 now divide this by 2 and 4112 gt rem 1 2052 gt rem

A cookie recipe calls for the following ingredients: • 1.5 cups of sugar • 1 cup of butter • 2.75 cups of flour The recipe produces 48 cookies with this amount of ingredients. Write a program that asks the user how many cookies they want to make and then displays the number of cups of each ingredient needed for the specified number of cookies in the following format: You need 5 cups of sugar, 3 cups of butter, and 7 cups of flour.

Answers

The program that asks the user how many cookies they want to make and then displays the number of cups of each ingredient is corresponds to the ingredients mentioned above.

Further explanation

Python is a general-purpose programming language. We want to write a python program that asks the user how many cookies they want to make and then displays the number of cups of each ingredient.

48 cookies = 1.5 cups of sugar + 1 cup of butter + 2.75 cups of flour, so:

def main():

   cookies = float(input("How many cookies would you like to make?\n>"))

   sugar = (1.5 * cookies) / 48.0

   butter = cookies / 48

   flour = (2.75 * cookies) / 48

   print("To make ", cookies, " cookies, you will need:\n", \

         format(sugar, '.2f'), " cups of sugar\n", \

         format(butter, '.2f'), " cups of butter\n", \

         format(flour, '.2f'), " cups of flour", sep='')

   redoQuery()  

def redoQuery():

   yn = input("Would you like to check another batch size? (y/n)\n>")

   if yn == 'y':

       main()

   elif yn =='n':

       exit()

   else:

       print("Please enter only a lowercase \'y\' or lowercase \'n\'," \

             "then press enter")

       redoQuery()

main()

The run program is shown in the attachment below.

Learn more

1. Learn more about python https://brainly.in/question/8049240

 

Answer details

Grade:  9

Subject: Computers and Technology

Chapter:  programming with python

Keywords: python

The DSL technology is a a) Broadband b) Narrowband c) Both a) & b) d) None of the above

Answers

Answer:both

Explanation:

briefly explain what is net neutrality and why is it important today

Answers

Net neutrality also means that ISPs can't charge users access fees for particular websites. ... The goal of net neutrality is to ensure that businesses can compete freely on the internet without having to pay gatekeeper tolls. Without it consumers would look more like advertising segments than an open marketplace.

Credits: thestreet.com

What is the primary means by which attackers infect computers with these attacks? How do these attacks commonly occur?

Answers

Well.. from personal experience...that’s ransomware..... these attacks usually occur when a HackerMan injects a file that contains the payload .... usually system configuration files...DLL’s, EXE, pretty much any file that contains codes that can modify someone’s operating system. This payload then locks your files so that you can only unlock your files using a key that can be purchased online.You enter the key? Your files are unlocked!

Do you think robots will take millions of jobs when they're put in different positions such as doctors or taxi drivers?

Answers

Yes, of course.

When you replace people with technologically advanced robots, it can disturb the economic factors. Although I don't agree with using robots as an every day, common thing, such as self-driving cars or like in the question, using robots as doctors. Technology is technology, it will always need updates and sometimes they break down or need repairs, so that could provide jobs for people; tech jobs that is. Not everybody is tech savvy though, but you learn. I still don't agree with it, but it is what it is.

Explain why it is reasonable to assume that receiving 3 duplicate ACKs in TCP is an indication that the network is not currently congested.

Answers

Answer:

to indicate if it is the account owner trying to log in

Assuming that your company uses the Class A network 100.0.0.0/8, with what subnet mask would you need to configure all computers on the network to divide this network 11 times to match the comany's 11 departments?

Answers

Answer:

Class A network 100.0.0.0/8, we need to divide it so that it can use 11 department, therefore 2^{4} = 16 maximum subnet. The subnet mask 255.240.0.0/12. The hosts per subnet are 2^20 = 1048574. The first 5 subnet range is attached with this question.

Explanation:

The IP address is 32 bits, The default subnet of class A is 255.0.0.0/8, but in this case we take 4 bits from host and add it to network bits so 8+4 = 12, that's why mask bit is 12.

8 bits   + 8 bits  +  8 bits  + 8 bits

100       .    0       .     0       .      0

we take 4 bits from 2nd octet so that it can use in 11 departments, so the remaining  4 bits + 8 bits + 8 bits = 20 bits

2^{20} = 1048574 hosts in each subnet

2^ {4} = 16 subnet ( 0 to 15 range)

when we subtract 255-15 = 240 so that the subnet mask is 255.240.0.0 / 12

how is hardware different from sofware?

Answers

Answer:

Computer hardware is any physical device used in or with your machine, whereas software is a collection of code installed onto your computer's hard drive. For example, the computer monitor you are using to read this text and the mouse you are using to navigate this web page are computer hardware.

All software utilizes at least one hardware device to operate. For example, a video game, which is software, uses the computer processor (CPU), memory (RAM), hard drive, and video card to run. Word processing software uses the computer processor, memory, and hard drive to create and save documents.

what is a Web application?

Answers

Answer:

A web application is a computer program that utilizes web browsers and web technology to perform tasks over the Internet.

Explanation:

Web applications include online forms, shopping carts, word processors, spreadsheets, video and photo editing, file conversion e.t.c.

Write a C++ program that prompt the user to enter three points (x1, y1), (x2, y2), (x3,y3) of a triangle and

Answers

Answer:

#include<iostream>

using namespace std;

int main(){

   int x1,x2,x3;

   int y1,y2,y3;

   cout<<"Enter the value of first point(x1,y1): ";

   cin>>x1>>y1;

   cout<<"\nEnter the value of second point(x2,y2): ";

   cin>>x2>>y2;

   cout<<"\nEnter the value of third point(x3,y3): ";

   cin>>x3>>y3;

   

}

Explanation:

first include the library iostream for use the input/output commands

then, write the main function. within the main function declare the variable which store the value of points.

after that, use the 'cout' for output. It has the function which print the value or message on the screen.

and 'cin' is used to store the value in the variable.

So, in the above code cout ask for enter the value of point and after enter value by user, cin store in the variables.

Note: you have to enter two value with space or by enter.

Write a program to read 2 numbers and display the largest of the two. You should use scanfto read the two numbers and use if statement to see which number is larger

Answers

Answer: in C

#include <stdio.h>

int main(){

  int num1, num2;

  printf("Enter first number :: ");

  scanf("%d", &num1);

  printf("Enter second number :: ");

  scanf("%d", &num2);

 

  if(num1 > num2){

     printf("%d is larger than %d\n", num1, num2);

  } else if (num2 > num1) {

     printf("%d is larger than %d\n", num2, num1);

  } else{

     printf("Both of them are equal\n");

  }

  return 0;

}

_____ is a major factor in the widespread use of global information systems

Answers

Answer:

E-business

Explanation:

Do you think that using robots at home would be good and helpful?

Answers

Answer:

Yes

Explanation:

 would use a robot for :

organize the bedrooms

laundry

cleaning

cooking etc...

The robot I want to use is a robot that can do everything and can be remotely controlled from anywhere. Especially do the boring task while I relax.

The method used to add panels to a JTabbedPane is

newTab.
newPanel.
addPanel.
addTab.

Answers

Answer:

Explanation:

by the ecosystem

Most tkinter components, like frames and buttons, have a constructor that accepts __________ as its first argument.

A. the parent component
B. the child component
C. the root window
D. a frame

Answers

D . A frame , cause that’s what most tkinter components

Sort the array A = [ 3, 1, 4, 1, 5, 9, 2, 6, 5] using insertion sort and illustrate your solution?

Answers

Answer:

Sorted list : [1, 1, 2, 3, 4, 5, 5, 6, 9]

Explanation:

For j= 2 to length of A

we find the place for A[j] in the sub-array A[1,..., j]

Taking i from j-1 to 1, if A[i] is greater than A[j] we shift it to right.

Why using a faster computer doesn’t always solve large data processing problems.

Answers

Answer:

maybe it doesn't have enough space to store data

Which of the following statements is true of offshore outsourcing?a. Improved telecommunication systems have increased its attractiveness.b. The limited availability of the Internet has reduced its effectiveness.c. Reduced bandwidth has increased its efficiency to perform with low latency.d. The increased cost of communication has reduced its popularity.

Answers

Jansjsfajhabsbsbsjs. Hbabajajajajanakslsk. Jshsbsjshsbshdjshjd ds

The correct answer is A. Improved telecommunication systems have increased its attractiveness.

Explanation:

Offshore outsourcing occurs in companies when these transfer or delegate certain roles or responsibilities to other companies abroad. This business strategy is closely related to the use of information and communication technologies or telecommunication systems as it is through these, the main company can conduct its operations in a different region or country.

Due to the development of telecommunications, during the last years outsourcing has become quite popular as nowadays the multiple technologies allow companies to communicate with people all around the world, send documents and papers, create meetings, and other functions that are necessary for companies. Therefore, the statement that is true about offshore outsourcing is "Improved telecommunication systems have increased its attractiveness".

Write a JAVA program to generate the list of prime numbers between 100 and 1000 ?

Answers

First of all, we will need a function that checks if a number is prime or not:

boolean isPrime(int n){

 for(int i=2; i<=math.sqrt(n); i++){

   if(n % i == 0) return false;

 }

 return true;

}

Then, in the main program, we will call this function with all the desired inputs, and we will print the prime numbers:

for(int n=100; n<= 1000; n++){

 if(isPrime(n)) print(n);

}

What is the difference between a service pack and a hotfix?

Answers

Hotfix - update to fix a very specific issue, not always publicly released. ... Service Pack - Large Update that fixes many outstanding issues, normally includes all Patches, Hotfixes, Maintenance releases that predate the service pack.

Answer:

i dont get it

Explanation:

i dont get it

ISDN stands for Internet Services Dynamic Network True/False

Answers

The answer is the second option "false." ISDN does not stand for Internet Services Dynamic Network it stands for Integrated Services Digital Network. ISDN is the international communication center for sending data, video, and voice over telephone wires.

Hope this helps.

Final answer:

ISDN stands for Integrated Services Digital Network. It is a set of communication standards that enables the transmission of voice, data, video, and other digital communication services over traditional telephone lines.

Explanation:

ISDN stands for Integrated Services Digital Network. It is a set of communication standards that enables the transmission of voice, data, video, and other digital communication services over traditional telephone lines. ISDN provides faster and more reliable internet connections compared to dial-up or analog connections.

ISDN utilizes digital signals and can carry multiple channels of data simultaneously. It offers a variety of services such as voice calls, video conferences, and data transfers. In contrast, dynamic networks are networks that can adapt and change their configuration dynamically based on various factors such as network traffic or device availability. The term 'Internet Services Dynamic Network' does not accurately represent the acronym 'ISDN.'

What are the defenses to protect against these attacks?

Answers

McAfee, Norton(totally overprotective tho), if you have a Chromebook Chrome OS(even more protective), Windows Defender on Win 10...

how do computers benefit individuals' health care?

Answers

Answer:

By having personal health records available on a computer, more doctors have access to an individual's information. This allows doctors to view all prescriptions that a person is on, which can help protect patients from conflicting medications to be taken at once, and can save time if a patient doesn't have to redo tests and procedures because the doctor doesn't have the records.

How are CGI programs different from Servlets?

Answers

Both Java servlets and CGI are utilized for generating dynamic web statements that admit a user application, process it on the server side and deliver answers to the user.

Servlets maintain various abilities that are challenging or difficult to achieve with conventional CGI. These abilities incorporate speaking directly to the network server,  sending data within various servlets, assembly tracking and maintaining of premature calculations.

Since servlets are composed in the Java programming dialect and develop a conventional API, so a servlet can be transferred from among web server. On the other hand, CGI programs may be principles subordinate, need to be recompiled or web server dependent.

How does 802.11g differ from 802.11b and 802.11a?

Answers

Try this explanation:

802.11a - the 1st generation, frequency - 5 GHz, max. data speed is 54 Mbits/sec.

802.11b - the 2d generation, frequency - 2.4 GHz, max. data speed is 11 MBits/sec.

802.11n - the last generation, frequency are - 2.4 & 5 GHz, max. data speed is 150 MBits/sec. and 600 MBits/sec. Supports 802.11a and 802.11b standarts.

how are natural numbers, whole numbers, integers, and rational numbers related

Answers

Each can be a classification within another group of numbers.

For example:
All whole numbers can be natural numbers (but not the other way around)
All natural numbers and all whole numbers can be integers (also not the other way around)
All natural numbers, whole number and integers can be rational (not the other way around :):):)):))

Natural numbers: 1, 2, 3, 4...

Whole numbers: 0, 1, 2, 3...

Integers: -2, -1, 0, 1, 2...

Rational number: -2.5, -1.72, 0, 1, 3.77... (any number that can be written down)

Which statement regarding Java files is false?

Java imposes no structure on a file.

Notions like “record” do not exist in Java files.

The programmer must structure files to meet the requirements of applications.

Records in a Java sequential file are stored in order by record key.

Answers

Answer:

Records in a Java sequential file are stored in order by record key.

Answer:

Records in a Java sequential file are stored in order by record key.

Q10. The percentile rank allows the researcher to determine:

a. what percentage of individuals in the sample scored above the target individual.

b. the mean for the population based on the mean for the sample.

c. how far a target individual’s score is from the group mean.

d. what percentage of individuals in the sample scored below the target individual.

Answers

I think the answer is a
Final answer:

The correct answer is option (d), which states that the percentile rank indicates what percentage of individuals in the sample scored below the target individual.

Explanation:

The percentile rank is a statistical measure that indicates the value below which a given percentage of observations in a group of observations falls. For example, to find the 90th percentile, you would identify the score k where 90 percent of the scores are the same as or below k, and 10 percent are above it. This means if you are at the 90th percentile in test scores, you scored better than 90 percent of the other test takers.

Interpreting percentiles is essential as it gives us information about the relative standing of an individual within a distribution. It is not a reflection of the actual score but instead a comparison with others' scores. Choice (d) is the correct answer to the question because the percentile rank tells us what percentage of individuals in the sample scored below the target individual.

Other Questions
A six-sided number cube is rolled twice.What is the probability that the first roll is an even numbe and the second roll is a number greater than 4? In the example we modeled the world population in the second half of the 20th century by the equation P(t) = 2560e^(0.017185t). Use this equation to estimate the average world population during the time period of 1950 to 2000. (Round your answer to the nearest million.) Who stood to gain from the Tariff of Abominations, and who expected to lose by it? What have been the effects of slavery on African Americans? Your fish tank holds 35 liters of water. How much is that in milliliter At the beginning of the war, why was Hitler allowed to continue his aggression without resistance from other European countries?A. Most European nations wanted to avoid war at all costs.B. Most European nations supported Hitler's war tactics.C. Hitler's invasion of Poland was considered unimportant.D. Hitler had not disobeyed the terms of the Munich Conference. Which of the following is true for the actual yield of a reaction? It is always calculated as a ratio. It is the yield from the excess reactant. It is the yield from the limiting reactant. It is always less than the theoretical yield. Around 20% of all yearly deaths in the United States can be attributed to chronic __________ use.A. tobaccoB. heroinC. cocaineD. marijuana If the discriminant if a qudratic equation is 4, which statement describes the roots? Which of the following are indications for using parenteral nutrition? Select all that apply.a. Paralytic ileusb. Severe short bowel syndromec. Dysphagiad. Comae. Good peripheral veinsf. Need for more kilocalories and nutrients Which of the following interpretation for the given sentence is correct? WILL MARK BRAINLIEST what was the common nick name for ellis island What is the main reason Mao Zedong was able to make China communist?A. The landlords supported him because he demanded obedience.B. The business owners supported him because he wanted to industrialize China.C. The peasants supported him because he promised them land.D. The warlords supported him because he promised them tax revenues. The U.S. President is elected by the Electoral College, and the Prime Minister is the leader of the majority party elected to parliament. Although neither are directly elected by the people, they are both put there indirectly by the voice of the people. Do you think this is an appropriate structure for a democratic society? Why or why not? What is the significance of the discovery: E = mc2? Mass moving at the speed of light has energy. Any moving mass emits energy. Mass and energy can convert to one another. none of the above Causes and effects of the great depression The mass of a piece of aluminum is 250 grams. The density of aluminum is 2.7 g/mL. What is the volume of the piece of aluminum? Why had conditions in France deteriorated in 1778 and 1789? What is the name of a polygon that has four congruent sides and theses angle measures 60,120,60,120?