Question

In: Computer Science

Calories Burned Running on a particular treadmill, you burn 4 calories per minute. Write a program...

Calories Burned

Running on a particular treadmill, you burn 4 calories per minute. Write a program that uses a loop to display the number of calories burned after 5, 10, 15, 20, 25, and 30 minutes.

Note the answer should be in assembly language using windows 32 and .586

Solutions

Expert Solution

    #include <iostream>
    #include <iomanip>
    using namespace std;

    // =============================================================

    int main(){
        cout<<"============================================\n";
        cout<<"\t     :: Information ::\n";
        cout<<"This program is used to display the total\n";
        cout<<"number of the burned calories after running\n";
        cout<<"specific intervals from 5 to 30 minutes.\n";
        cout<<"============================================\n";
        
        // ---------------------------------------------------------
        // Definitions
        const float CAL_PER_MIN = 3.6;
        
        for(int min=5; min<=30; min+=5){
            // -----------------------------------------------------
            // Within each iteration, we multiply the ratio by the
            // iteration number starting from 5 to 30 because the
            // burned calories are the same every 5 minutes.
            // :::::::::::::::::::::::::::::::::::::::::::::::::::::
            // NOTE we used the update part to increment by a 5 each
            //      time.
            // :::::::::::::::::::::::::::::::::::::::::::::::::::::
            // setw and setfill are for formatting only and defined
            // in <iomanip> header.
            // -----------------------------------------------------
            cout<<"After running "<<setfill('0')<<setw(2)<<min
                <<" minutes,\n";
            cout<<"\tthe calories burned are "<< min*CAL_PER_MIN
                <<"\n\n";
        }
        
        cout<<"============================================\n";
        return 0;
    }

--------------------------------------------------------------------------------------------------------------------------------------------

             output


Related Solutions

Running on a particular treadmill you burn a specific number of calories per minute. Write a...
Running on a particular treadmill you burn a specific number of calories per minute. Write a python program that uses a loop (you must use a loop) to display the number of minutes (as an integer) it will take to burn greater than or equal to 100 calories. For example (user input indicated in bold): SAMPLE 1: How many calcories burned per minute? 54.3 2 minutes SAMPLE 2: How many calcories burned per minute? 4.3 24 minutes SAMPLE 3: How...
In 80X86 assembly language Calories Burned Running on a particular treadmill, you burn 4 calories per...
In 80X86 assembly language Calories Burned Running on a particular treadmill, you burn 4 calories per minute. Write a program that uses a loop to display the number of calories burned after 5, 10, 15, 20, 25, and 30 minutes pls show input and output
Why is it surprising that hunter-gatherers burn the same number of calories per day as a...
Why is it surprising that hunter-gatherers burn the same number of calories per day as a sedentary person in a western society?
Thirty-minute workouts of one of the following will lead to burning the following calories. You wish...
Thirty-minute workouts of one of the following will lead to burning the following calories. You wish to test to see if there is a difference in the amount of calories burned from these three activities. Swimming Tennis Cycling 408 415 385 380 485 250 425 450 380 400 420 402 427 530 268 What is the p-value and your conclusion? p value = 0.0098 and conclude fail to reject the null the three activities are identical and tennis tends to...
We have a list of runner and their running time, write a program in Java to...
We have a list of runner and their running time, write a program in Java to show the fastest runner and their time.
If you are running a test to find out whether or not a particular drug works...
If you are running a test to find out whether or not a particular drug works better than a placebo in controlling depression, and you have no idea whether the effects of the drug will increase depression or decrease depression, you want to run a_______ Research study One-Tailed Test NHST Two-Tailed Test When you incorrectly reject the null hypothesis and claim there are significant differences between your two means, and no such difference exists in the population, you have a(n)______...
Breathing rates for humans can be as low as 4 breaths per minute or as high...
Breathing rates for humans can be as low as 4 breaths per minute or as high as 70 or 75 for a person doing strenuous exercise. Suppose that the resting breathing rates for college-age students have a distribution that is mound-shaped, with a mean of 12 and a standard deviation of 2.3 breaths per minute. What fraction of all students have breathing rates in the following intervals. a. 9.7 to 14.3 breaths per minute b. 7.4 to 16.6 breaths per...
WRITE A C++ PROGRAM: QUESTION 1 Assume you have a hobby to collect a particular type...
WRITE A C++ PROGRAM: QUESTION 1 Assume you have a hobby to collect a particular type of items. Specify the category to which the items you collect belong to ____________________________ [2 points] Define a struct with the name the same as the category that you filled in the blank above [4 points] The struct must have at least two members corresponding to properties relevant to the items in the category you specified. The struct members must have names meaningful to...
Objective: Write a program that simulates a robot running a queue of commands to move around...
Objective: Write a program that simulates a robot running a queue of commands to move around a board with obstacles. Requirements: The board is composed of spaces that are either empty (“_”) or have an obstacle (“X”). Also the board is assumed to be 10x10 spaces. The robot (“O”) has an x and y position corresponding to its location on the board, and four commands: move up, move down, move left, and move right. Both the board and the robot’s...
Problem 2. You wish to determine the energy content per gram and Calories per serving of...
Problem 2. You wish to determine the energy content per gram and Calories per serving of a chocolate chip cookie and a banana bread slice from the Student Union to decide which is less “fattening.” The intact cookie and banana bread slice you are analyzing weigh 72.501 g and 69.003 g, respectively. Before you can analyze the samples, the calorimeter heat capacity must be determined. It is known that combustion of 1.000 g of benzoic acid releases 26.44 kJ of...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT