Please I need in 4 hours!! which part is missing?

Pages: 12
closed account (9N7koG1T)
hey men,, you were wrong.. lecture gave me 2.3 point on 3.. I was disappointted.. he said "I need to see OUTPUTS".. I knew there was something missing.. we didn't show the outputs,, that's why I was asking to you!!! but you guys wrote same thing like I typed.
The assignment clearly stated that you had to submit the output, so why are you surprised?
You are welcome, at least you got 2.3 / 3.
closed account (9N7koG1T)
so what is the correct code-? how can I submit the outputs? The assingment is over I am just wondering..
You run your program, select all the text and choose "copy". Then you can paste it in your e-mail or wherever.
Alternatively, write the output to a file with the syntax yourpogram.exe > outputfile.txt (from the console).

And this would be a solution that honors the requested formatting:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include <iostream>
using namespace std;

int main()
{
  double Fah,Kel,Cel,Ran,Rea;

  cout << " Type a temperature in Fahrenheit and press ENTER: " << flush;
  cin >> Fah;

  Kel=(Fah + 459.67)*5 /9;
  Cel=(Fah-32)*5 /9;
  Rea=(Fah-32)*4 /9;
  Ran=Fah+459.67;

  cout << Fah << " degree Fahrenheit in\n";
  cout.setf(ios::fixed, ios::floatfield);
  cout.precision(2);
  cout << "...Kelvin is " << Kel << '\n';
  cout << "...Celsius is " << Cel << '\n';
  cout << "...Rankine is " << Ran << '\n';
  cout << "...Reaumur is " << Rea << endl;
}
closed account (9N7koG1T)
Prompt the user to enter a date in the YYYYMMDD format. Example: 10 March 2010 is 20100310.

Read the user input into a variable.

Print an error message and exit the program if the user enters a negative number.

Split the YYYYMMDD number into its respective YYYY, MM, DD pieces using integer division and the modulus operator. [hint: 20100101 / 10000 = 2010 and 20100101 % 10000 = 101]

Print a line that has the following format.
YYYYMMDD is MM/DD/YYYY

examples...

20100314 is 3/14/2010
19571105 is 11/5/1957
20380118 is 1/18/2038

Your source code file must contain a file comment block. In addition, you need to turn in a printed copy of the output generated by your program for at least three different inputs.
closed account (9N7koG1T)
#include <iostream>
using namespace std;


int main() {

long int longdate = 20120305, newlongdate;
int Day,Month,Year;
do {d:

cout<<" Enter Long Date (yyyymmdd) "<<endl;
cin>>longdate;

}

while(longdate<0); {

Month = (int)longdate %100; // month

longdate /=100;


Day =(int) longdate % 100; //getting date

longdate /=100;


Year =(int) longdate;
} //year

goto d;
cout<< longdate <<" is "<< Day <<" / " <<Month<<" / " <<Year<<endl;



system("pause");
return 0;
}
closed account (9N7koG1T)
Hey huys again me :) I wrote this code but there is something wrong..what do you think?
I think you need to make a new thread instead of recycling this old one, with a more appropriate subject than this one. When you do that, perhaps you can use code tags and be a little less vague than "something is wrong."
Topic archived. No new replies allowed.
Pages: 12