| |||||||
![]() |
| | LinkBack | Thread Tools | Display Modes |
| | #1 |
| I wanna be Dave ![]() Join Date: Dec 2005 Location: Hawthorne, Florida
Posts: 2,568
| Have a question....trying to get a blank line where I have it listed in yellow. What am I missing. //John ###### //COP1000.052 //This program calculates the sum, average, median, minimum and maximum of 3 input numbers. #include usingnamespace std; int main() { float median; float numberone; float numbertwo; float numberthree; cout << "This program calculates the sum,average, median, minimum \n" ; cout << "and maximum from 3 input numbers." << endl << endl; cout << "Please input the first value: "; cin >> numberone; WOULD LIKE A BLANK LINE HERE cout << "Please input the second value: "; cin >> numbertwo; WOULD LIKE A BLANK LINE HERE cout << "Please input the third value: "; cin >> numberthree; WOULD LIKE A BLANK LINE HERE cout << "The three input numbers entered are:" << numberone << ", " << numbertwo << ",and " << numberthree << endl << endl; if ((numberone >= numbertwo && numberone <= numberthree) || (numberone >= numberthree && numberone <= numbertwo)) median = numberone; elseif ((numbertwo >= numberone && numbertwo <= numberthree) || (numbertwo >= numberthree && numbertwo <= numberone)) median = numbertwo; else median = numberthree; cout << "The sum is:" << (numberone + numbertwo + numberthree) << endl << endl; cout << "The average is:" <<((numberone + numbertwo +numberthree)/3) << endl << endl; cout << "The maximum is:" << max(max(numberone, numbertwo), numberthree)<< endl << endl; cout << "The median is:" << median << endl << endl; cout << "The minimum is:" << min(min(numberone, numbertwo), numberthree)<< endl << endl << endl << endl; cout << "Thank you for playing. \n" << endl << endl; return 0; } |
| | |
| Sponsored Links | |
| | #2 |
| I wanna be Dave ![]() Join Date: Jan 2005 Location: Hueytown, Alabama
Posts: 6,796
| < p > |
| | |
| | #3 |
| I wanna be Dave ![]() Join Date: Dec 2005 Location: Hawthorne, Florida
Posts: 2,568
| |
| | |
| | #4 |
| I wanna be Dave ![]() Join Date: Jan 2005 Location: Hueytown, Alabama
Posts: 6,796
| |
| | |
| | #5 |
| Wishing I was Crawling ![]() Join Date: Feb 2007 Location: Missouri Boot-Heel
Posts: 756
| not 100% but try these. cout <<'\n << \n' cout <<'\\n << \\n' |
| | |
| | #6 |
| I wanna be Dave ![]() Join Date: Jan 2004 Location: Detroit
Posts: 2,328
| |
| | |
| | #7 |
| I wanna be Dave ![]() Join Date: Dec 2005 Location: Hawthorne, Florida
Posts: 2,568
| I had already tried that but it didn't space like I wanted. It did this instead Please enter first value 10 Please enter second value 20 Please enter third value 30 I was trying to get it to look like this Please enter first value: 10 Please enter second value: 20 Please enter third value: 30 This is how it is as I have it written now... Please enter first value:10 Please enter second value:20 Please enter third value:30 |
| | |
| | #8 |
| I wanna be Dave ![]() Join Date: Jan 2004 Location: Detroit
Posts: 2,328
| |
| | |
| | #9 |
| I wanna be Dave ![]() Join Date: Dec 2005 Location: Hawthorne, Florida
Posts: 2,568
| |
| | |
![]() |
| Thread Tools | |
| Display Modes | |
| |