Question

This block of code goes in donation_total. This block tallies all the donations made to the local community center. The progr
in c++ and must use loops
0 0
Add a comment Improve this question Transcribed image text
Answer #1

#include<iostream>
using namespace std;
int main(){
   double total=0;
   double amount;
   //reading total untill user gives negative
   while(true){
       cin>>amount;
       //checking if it is negative value than break
       if(amount<0)
           break;
       //adding to total
       total+=amount;
   }
   if(total>100)
       cout<<"Send a t-shirt"<<endl;
   cout<<"Total donations made $"<<total;
}

#include<iostream> 1 using namespace std 3-int main( ) { 2 double total-0; double amount; 4 //reading total untill user gives

Note : Please comment below if you have concerns. I am here to help you

If you like my answer please rate and help me it is very Imp for me

Add a comment
Know the answer?
Add Answer to:
in c++ and must use loops This block of code goes in donation_total. This block tallies...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 학수번호 Course Code 수업담당교수 nstructor 과목명 일반물리학1 Subject 수업정보 Class Time 요일 Day me 유의사항 |....

    학수번호 Course Code 수업담당교수 nstructor 과목명 일반물리학1 Subject 수업정보 Class Time 요일 Day me 유의사항 |. Electronic calculator is not allowed!! Note 2. Answer the questions in English or Kor 1] 125 points] A self-driving car is equipped with a device that detects an object by measuring the distance from the car to the object. After an object is detected, it takes 0.1 sec for the car to decide whether it stops or not. With the decision to stop made,...

  • LANGUAGE IS C++ Lab Ch14 Recursion In this lab, you are provided with startup code which...

    LANGUAGE IS C++ Lab Ch14 Recursion In this lab, you are provided with startup code which has six working functions that use looping (for, while, or do loops) to repeat the same set of statements multiple times. You will create six equivalent functions that use recursion instead of looping. Although looping and recursion can be interchanged, for many problems, recursion is easier and more elegant. Like loops, recursion must ALWAYS contain a condition; otherwise, you have an infinite recursion (or...

  • This is done in c programming and i have the code for the programs that it wants at the bottom i ...

    This is done in c programming and i have the code for the programs that it wants at the bottom i jut dont know how to call the functions Program 2:Tip,Tax,Total int main(void) {    // Constant and Variable Declarations    double costTotal= 0;    double taxTotal = 0;    double totalBill = 0;    double tipPercent = 0;    // *** Your program goes here ***    printf("Enter amount of the bill: $");    scanf("%lf", &costTotal);    printf("\n");    // *** processing ***    taxTotal = 0.07 * costTotal;    totalBill...

  • Must Follow Example code //Add name, date, and description here //preprocessor directives #de fine CRT SECURE...

    Must Follow Example code //Add name, date, and description here //preprocessor directives #de fine CRT SECURE NO WARNINGS #includestdio.h> - //Calculate the cost of the gas on a trip /Ideclare, ask, and get the price per gallon and the mpg /Icalculate and return (by reference) the cost of gas for the number of miles passed to the function void GasCost (double miles, double *gasTotalPtr) //using a 70 MPH speed limit and the miles passed to the function //calculate and return...

  • Edit a C program based on the surface code(which is after the question's instruction.) that will...

    Edit a C program based on the surface code(which is after the question's instruction.) that will implement a customer waiting list that might be used by a restaurant. Use the base code to finish the project. When people want to be seated in the restaurant, they give their name and group size to the host/hostess and then wait until those in front of them have been seated. The program must use a linked list to implement the queue-like data structure....

  • You need not run Python programs on a computer in solving the following problems. Place your...

    You need not run Python programs on a computer in solving the following problems. Place your answers into separate "text" files using the names indicated on each problem. Please create your text files using the same text editor that you use for your .py files. Answer submitted in another file format such as .doc, .pages, .rtf, or.pdf will lose least one point per problem! [1] 3 points Use file math.txt What is the precise output from the following code? bar...

  • Develop a case study analysis in the following format Relevance of the case study to my...

    Develop a case study analysis in the following format Relevance of the case study to my work environment - application - learning impact CASE 4-1 Tambrands Overcoming Cultural Resistance Tampax, Tambrands's only product, is the best-selling tampon in their virginity if they use a tampon. When they go to the beach in the world, with 44 pencent of the global market North America and tiny bikinis, tampons arent their choike. Instead, hordes of women Europe account for 90 percent of...

  • Read about Cokes strategy in Africa in the article below and discuss the ethics of selling...

    Read about Cokes strategy in Africa in the article below and discuss the ethics of selling soft drinks to very poor people. Is this an issue that a company like Coke should consider? Africa: Coke's Last Frontier Sales are flat in developed countries. For Coke to keep growing, Africa is it By Duane Stanford Piles of trash are burning outside the Mamakamau Shop in Uthiru, a suburb of Nairobi, Kenya. Sewage trickles by in an open trench. Across the street,...

  • do SWOT analysis. CASE 01 Mystic Monk Coffee connect . David L. Turnipseed University of South...

    do SWOT analysis. CASE 01 Mystic Monk Coffee connect . David L. Turnipseed University of South Alabama . wishing to donate to the monks' cause. Father Prior Daniel Mary did not have a great deal of experience in business matters but considered to what extent the monastery could rely on its Mystic Monk Coffee operations to fund the purchase of the ranch. If Mys- tic Monk Coffee was capable of making the vision a reality, what were the next steps...

  • And there was a buy-sell arrangement which laid out the conditions under which either shareholder could...

    And there was a buy-sell arrangement which laid out the conditions under which either shareholder could buy out the other. Paul knew that this offer would strengthen his financial picture…but did he really want a partner?It was going to be a long night. read the case study above and answer this question what would you do if you were Paul with regards to financing, and why? ntroductloh Paul McTaggart sat at his desk. Behind him, the computer screen flickered with...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT