May 7th, 2009, 05:16 AM
#1
Half of program not showing up in console
Ok, im programming a program to help my little sister with her maths and have of the program doesnt show up in the console when I go to compile.
Line 43 and below are the ones that do not show up on screen.
If someone could help me with this, it would be greatly appreciated
Code:
//Fraction Divider
#include <iostream>
#include <stdlib.h>
using std::cout;
using std::cin;
int main()
{
int firstNum, firstDen, secondNum, secondDen, multiplyOne, multiplyTwo;
cout << "\t\tWelcome to Fraction Divider\n\n";
cout << "Please only insert IMPROPER FRACTIONS\n\n";
cout << "Insert NUMERATOR of first fraction:";
cin >> firstNum;
cout << "Insert DENOMINATOR of first fraction:";
cin >> firstDen;
cout << "\nInsert NUMERATOR of second fraction";
cin >> secondNum;
cout << "Insert DENOMINATOR of second fraction";
cin >> secondDen;
cout << firstNum;
cout << "\n--\n";
cout << firstDen;
cout << "\n";
cout << "\tDivided by\n\n"
cout << secondNum;
cout << "\n--\n";
cout << secondDen;
cout << "\n";
cout << "\n\nIf that is correct, see below. If not, restart the program\n\n";
// THE PROBLEM MENTIONED IN FORUMS BEGIN HERE!
// ALl TEXT FOLLOWING THESE COMMENTS FAIL TO SHOW UP!
cout << "To divide fractions, we invert the second fraction and mulitply the new sum\n\n"
cout << "Now we have\n\n"
cout << firstNum;
cout << "\n--\n";
cout << firstDen;
cout << "\n";
cout << "\nMultiplied by\n\n"
cout << secondDen;
cout << "\n--\n";
cout << secondNum;
cout << "\n";
multiplyOne = (firstNum * secondDen);
multiplyTwo = (firstDen * secondNum);
cout << firstNum << "\tMultiplied by\t" << secondDen << "\t = \t" << multiplyOne << "\n" << endl;
cout << firstDen << "\tMultiplied by\t" << secondNum << "\t = \t" << multiplyTwo << "\n\n" << endl;
cout << "Answer:\n\n";
cout << multiplyOne;
cout << "\n--\n";
cout << multiplyTwo;
cout << "\n"
system("pause");
return 0;
}
Thanks
Cobrah
Attached Files
Last edited by Cobrah; May 7th, 2009 at 05:18 AM .
May 7th, 2009, 06:11 AM
#2
Re: Half of program not showing up in console
The only thing I see is a strange "\t" instead of "\n" in
Code:
cout << "\tDivided by\n\n"
May 7th, 2009, 11:34 AM
#3
Re: Half of program not showing up in console
Originally Posted by
olivthill2
The only thing I see is a strange "\t" instead of "\n" in
Code:
cout << "\tDivided by\n\n"
That's tab.
May 8th, 2009, 07:09 PM
#4
Re: Half of program not showing up in console
I found the problem:
An update I installed caused one of the files needed to compile to stop working. The problem was simply that the half that wouldn't show didn't compile.
Thanks anyway for your help
Cobrah
May 7th, 2009, 06:42 AM
#5
Re: Half of program not showing up in console
Originally Posted by
Cobrah
Ok, im programming a program to help my little sister with her maths and have of the program doesnt show up in the console when I go to compile.
Line 43 and below are the ones that do not show up on screen.
If someone could help me with this, it would be greatly appreciated
Code:
//Fraction Divider
#include <iostream>
#include <stdlib.h>
using std::cout;
using std::cin;
int main()
{
int firstNum, firstDen, secondNum, secondDen, multiplyOne, multiplyTwo;
cout << "\t\tWelcome to Fraction Divider\n\n";
cout << "Please only insert IMPROPER FRACTIONS\n\n";
cout << "Insert NUMERATOR of first fraction:";
cin >> firstNum;
cout << "Insert DENOMINATOR of first fraction:";
cin >> firstDen;
cout << "\nInsert NUMERATOR of second fraction";
cin >> secondNum;
cout << "Insert DENOMINATOR of second fraction";
cin >> secondDen;
cout << firstNum;
cout << "\n--\n";
cout << firstDen;
cout << "\n";
cout << "\tDivided by\n\n"
cout << secondNum;
cout << "\n--\n";
cout << secondDen;
cout << "\n";
cout << "\n\nIf that is correct, see below. If not, restart the program\n\n";
// THE PROBLEM MENTIONED IN FORUMS BEGIN HERE!
// ALl TEXT FOLLOWING THESE COMMENTS FAIL TO SHOW UP!
cout << "To divide fractions, we invert the second fraction and mulitply the new sum\n\n";
cout << "Now we have\n\n";
cout << firstNum;
cout << "\n--\n";
cout << firstDen;
cout << "\n";
cout << "\nMultiplied by\n\n";
cout << secondDen;
cout << "\n--\n";
cout << secondNum;
cout << "\n";
multiplyOne = (firstNum * secondDen);
multiplyTwo = (firstDen * secondNum);
cout << firstNum << "\tMultiplied by\t" << secondDen << "\t = \t" << multiplyOne << "\n" << endl;
cout << firstDen << "\tMultiplied by\t" << secondNum << "\t = \t" << multiplyTwo << "\n\n" << endl;
cout << "Answer:\n\n";
cout << multiplyOne;
cout << "\n--\n";
cout << multiplyTwo;
cout << "\n"
system("pause");
return 0;
}
Thanks
Cobrah
You're missing semi-colons (I have listed where they are). It shouldn't even compile..
May 7th, 2009, 07:26 AM
#6
Re: Half of program not showing up in console
Once I fixed the compile errors, it ran to the end for me.
May 9th, 2009, 01:22 AM
#7
Re: Half of program not showing up in console
That's a pretty odd problem.. what was the update and the affected file (in case someone else happens to have the same problem)?
May 11th, 2009, 02:05 AM
#8
Re: Half of program not showing up in console
Idk what the affected file was, but the update was something along the lines of:
-Windows Internet Explorer 8(tm) Vista Compatability Update.
I use Mozilla Firefox so it didn't really matter anyway
Tags for this Thread
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Click Here to Expand Forum to Full Width