1)john raymond was so pleased with the program you created for his clients that
ID: 3534523 • Letter: 1
Question
1)john raymond was so pleased with the program you created for his clients that he regers you to his coworker,a nutrionist in the same facility.The nutrionist would like you to create a program that calculates fat grams and calories.Design a program that asks for the number of fat grams and calories in a food item.Validate the input as follows:
-make sure the number of fat grams and calories are not less then 0.
-according to nutritional formulas,the number of calories cannot exceed fat grams x 9 . Make sure that the number of calories entered is not greater than fat grams x9.
Once correct data has been entered the program should calculate and display the percentage of calories that come from fat.Use the following formula: percentage of calories from fat=(fat grams x 9) / calories
some nutritionist classify a food as low fat if less than 30 percent of its calories come from fat.if the results of this fomrula are less then 0.3 the program should display a message indicating the food is low in fat
can someone help me create a flowchart for this one?,i already have a psuedocode ^^
__________________________________________________________________________________________
2)You been asked by a science muesum to create an application that displays information about planets to visitors. When users select a planet they should be able to read information about the selected planet to complete this project:
Create an application that displays the following menu:
select a planet
1.mercury
2.venus
3.earth
4.mars
5.exit the program
enter your selection
When the users select a planet from the menu,the program should disply data about the planets average distance from the sun,the planets mass and the planets surface temeperature.us the folloing data in your program:
1,mercury;
average distance from the sun 57.9 million kilometers
mass 3.31 x 10^24kg
surface temeprature -173 to 430 degress celcius
venus
average distancefrom the sun 108.2 million kilometers
mass 4.87 x 10^24kg
surface temerpature 472 degress celcius
earth average distance from the sun 149.6 million kiolmeters
mass 5.967 x 10^24kg
surface temerparture -50 to 50 degress celcius
mars
averiage distance from the sun 227.9 million kilometers
mass 0.6424 x 10^24kg
surface temperature -140 to 20 degress celcius
CREATE A PSEUDCODE
CREATE A FLOWCHART
Explanation / Answer
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
float fat_gram,cal,perc;
cout<<"Enter value for FAT_GRAM:";
cin>>fat_gram;
a:
cout<<" Enter Value for CALORIES:";
cin>>cal;
if(cal>9*fat_gram)
{
cout<<" !!Please Enter Proper Calories!!";
goto a;
}
perc=(fat_gram*9)/cal;
cout<<" Percentage Of Calories from Fat="<<perc;
if(perc<0.3)
{
cout<<" !!FOOD IS LOW IN FAT!!";
}
getch();
}
#include<iostream.h>
#include<conio.h>
void main()
{
int ch;
cout<<"YOUR ARSTONOMY CALCULATOR:";
cout<<" 1.Mercury";
cout<<" 2.Venus";
cout<<" 3.Earth";
cout<<" 4.Mars";
cout<<" 5.Exit";
cout<<" Enter your Choice:";
cin>>ch;
switch(ch)
{
case 1:cout<<" average distance from the sun 57.9 million kilometers";
cout<<" mass=3.31 x 10^24kg";
cout<<" surface temeprature -173 to 430 degress celcius";
break;
case 2:cout<<" average distancefrom the sun 108.2 million kilometers";
cout<<" mass=4.87 x 10^24kg";
cout<<" surface temeprature 472 degress celcius";
break;
case 3: cout<<" average distancefrom the sun 149.6 million kilometers";
cout<<" mass=5.967 x 10^24kg";
cout<<" surface temeprature -50 to 50 degress celcius";
break;
case 4: cout<<" average distancefrom the sun 227.9 million kilometers";
cout<<" mass=0.6424 x 10^24kg";
cout<<" surface temeprature -140 to 20 degress celcius";
break;
default:cout<<"Thank you!!"
}
getch();
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.