Albania
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Albania

...:::Forum...:::
 
ForumportalLatest imagesKërkoRegjistrohuidentifikimi

 

 Llogarit Shpejtesin.... C++

Shko poshtë 
AutoriMesazh
T3chn1calWolf
Admin
Admin
T3chn1calWolf


Male Numri i postimeve : 822
Age : 42
Qyteti : ne Form :P
Registration date : 07/01/2009

Llogarit Shpejtesin.... C++ Empty
MesazhTitulli: Llogarit Shpejtesin.... C++   Llogarit Shpejtesin.... C++ Icon_minitimeMon Mar 02, 2009 1:29 pm

Cito:

Programi i meposhtem llogarit shpejtesine mesatare, distancen dhe kohen per sa keni vrapuar nje milje(per ata qe vrapojne)
Kodi:
#include
#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 " <cout <<"You have been running with the speed of " <cout <<"You runned a mile in " <return 0;
}
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."<cin>>value;
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<perc1 =cof*100/(counter-2);
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 " <cout<<"The results of the survey: "<cout<cout<<"-------------------------------------------------------------------------------"<cout<cout<cout<cout<return 0;
}
Mbrapsht në krye Shko poshtë
https://albaniansharks.albanianforum.net
 
Llogarit Shpejtesin.... C++
Mbrapsht në krye 
Faqja 1 e 1

Drejtat e ktij Forumit:Ju nuk mund ti përgjigjeni temave të këtij forumi
Albania :: Qendra Shkarkimit :: Gjuhe Programuese-
Kërce tek: