- Kodi:
Programi i meposhtem llogarit shpejtesine mesatare, distancen dhe kohen per sa keni vrapuar nje milje(per ata qe vrapojne)
#include
using namespace std;
int main ()
{
float laps, time, speed, distance, aver;
cout << fixed<< setprecision(2);
cout <<"Enter the number of laps you run \n" ;
cin >> laps;
cout << "Enter the time of your run in seconds \n";
cin >> time;
distance=0.1456439 *laps;
speed=distance/3600*time;
aver=distance/60*time;
cout <<"Your total run length for today is " <
}Cito:
#include
#include
using namespace std;
int main()
{
int value=1, counter=1, cof=0, tea=0, oj=0, lem=0;
float perc1, perc2, perc3, perc4 ;
while (value!=5)
{cout<<"\nEnter your choice. Press: \n 1 for Coffee, 2 for Tea, 3 for Orange Juice, 4 for Lemonade or press 5 to quit."<
switch (value)
{
case 1: cof++;
break;
case 2: tea++;
break;
case 3: oj++;
break;
case 4: lem++;
break;
case 5: cout<<"You just decided to quit\n.";
break;
default: cout<< "Please enter a valid number 1, 2, 3, 4 or 5. Your choice will not be considered.";
break;
}
counter++;
}
cout<
perc2 =tea*100/(counter-2);
perc3 =oj*100/(counter-2);
perc4 =lem*100/(counter-2);
counter=counter-2;
cout<< "The total number of persons that have been surveyed is " <
}