Monday, March 28, 2011
Homework 1
#include<iostream.h>
main()
{
//variable
float as1,as2,as3,as4,as5,mid,final,total;
//input1
cout<<"assignment 1:";
cin>>as1;
//input2
cout<<"assignment 2:";
cin>>as2;
//input3
cout<<"assignment 3:";
cin>>as3;
//input4
cout<<"assignment 4:";
cin>>as4;
//input5
cout<<"assignment 5:";
cin>>as5;
//input6
cout<<"midterm:";
cin>>mid;
//input7
cout<<"final:";
cin>>final;
//formula
total = as1+as2+as3+as4+as5+mid+final;
//output
cout<<"assignment 1 is:"<<as1<<endl;
cout<<"assignment 2 is:"<<as2<<endl;
cout<<"assignment 3 is:"<<as3<<endl;
cout<<"assignment 4 is:"<<as4<<endl;
cout<<"assignment 5 is:"<<as5<<endl;
cout<<"mid score is:"<<mid<<endl;
cout<<"final score is:"<<final<<endl;
cout<<"total is:"<<total;
return 0;
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment