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

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
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...
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...
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...
Exercise 18: Running Ex. 16 You will write exercise 16 into a program and make it...
Exercise 18: Running Ex. 16 You will write exercise 16 into a program and make it run. Note that there are two parts, 16A and 16B. Type 16A into a program called Exercise16A and type 16B into a program called Exercise16B. Be sure label each section using comments. You may notice that additional code needs to be written for the program to run. For example, Section I assumed that an array was already declared and initialized. Here, you will have...
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)______...
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.
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...
Part 2: BasalMetabolicRate Write a Java program that estimates the number of calories your body needs...
Part 2: BasalMetabolicRate Write a Java program that estimates the number of calories your body needs to maintain your weight if you do no exercise. This is called your BMR (or Basal Metabolic Rate) and can be calculated with the Harris-Benedict equation. The calories needed for a woman to maintain her weight is: BMR (calories) = 655 + (4.35 * weight in pounds) + (4.7 * height in inches) - (4.7 * age in years) The calories needed for a...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT