ok everyone, i taking my first semester of C++ and i have a little quesiton, the teacher wants up to output and input on the same line, but to send the input through i have to strike enter, which keys to the next line, heres my code, just cant get it to work how i want it
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
const string MY_NAME = "Devon Crampton";
const string COURSE_NUMBER = "Lab 1 CST 113 -03";
const int YEAR = 2008;
const int RAWWOOL = 8;
const double SHEAR_COST = 2.25;
int main (void)
{
double inputWoolPrice;
double year = YEAR;
double price1;
double price2;
double price3;
double yearPriceWool;
double totalWool;
double shearTotal;
double rawProfit;
int totalSheep;
int wool1;
int wool2;
int wool3;
int numberOfSheep1;
int numberOfSheep2;
int numberOfSheep3;
// Output to the screen programmer's name and course number
cout.fill('*');
cout << setw(70+1) << " " << endl;
cout.fill(' ');
cout << endl;
cout << MY_NAME << endl;
cout << COURSE_NUMBER << endl;
cout << endl;
cout.fill('*');
cout << setw(70+1) << " " << endl;
cout.fill(' ');
cout<< endl;
// input price of wool
cout << " What is the selling price per pound of sheared wool for 2008? : ";
cin >> inputWoolPrice;
///----------------------------------------------------------------------------------
/// this is where i am having the problem \/
// input number of sheep in each field
cout << " Enter the number of sheep sheared from each field for 2008 : "<< endl;
// i have to have these 3 inputs and outputs on the same line
cout << " field 1 "; cin >> numberOfSheep1;
cout << " field 2 "; cin >> numberOfSheep2;
cout << " field 3 "; cin >> numberOfSheep3;
///----------------------------------------------------------------------------------
cout.fill('*');
cout << setw(70+1) << " " << endl;
cout.fill(' ');
cout<< endl;
right now they output like this
Enter the number of sheep sheared from each field for 2008 :
field 1 259
field 2 147
field 3 369
i need to have it output like this
Enter the number of sheep sheared from each field for 2008 :
field 1: 259 field 2: 147 field 3: 369
so that every time i strike enter or space it displayed the next output and prompts me for the input
any ideas, this one is stumping me, my tutor couldn't even help me..
thanks for the help !