This is my first post on here, so let me start off by saying, I have only been doing this kind of stuff for a month, I am very new to coding and programming and would appreciate as much help as I can get. I
I have a project for school. It's called 'Messages', and the teacher says it's not supposed to be that hard, some people in class have gotten it but I would like some extra help with everything.
Here is what I have to do for the project;
"Write a program that prints one of three APPROPRIATE messages depending on whether the user types 1, 2 or 3."
I have a majority of the project done (or a least I think I do) but there are a few things I still need help with.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
//Taylor Lynch
//Messages
//Print 3 Messages
//Period 5
#include <iostream.h>
#include <conio.h>
#include <dos.h>
#include <stdio.h>
main()
{
int x;
textcolor(WHITE);
cprintf("Enter either 1, 2 or 3: ");
cin>>x;
if(x>3)
{
cout<<”Number is not valid, Please try again”;
getch();
clrscr();
cprintf(“New Number: “);
cin>>x;
}
if(x<1)
{
cout<<”Number is not valid, Please try again”;
getch();
clrscr();
cprintf(“New Number: “);
cin>>x;
}
if(x==1)
{
cout<<”What is a teacher without students?”;
delay(100);
cout<<” Happy.”
}
if(x==2)
{
cout<<”Student: Would you punish me for something I didn’t do?\n”;
delay(200);
cout<<”Teacher: Of course not.\n”;
delay(200);
cout<<”Student: Good, because I didn’t do my C++ assignment.\n”;
}
if(x==3)
cout<<”Teacher: Where is your textbook?\n”;
delay(200);
cout<<”Student: It’s at my house.\n”;
delay(200);
cout<<”Teacher: Well, what is it doing there?\n”;
delay(200);
cout<<”Student: Having a better day than me.\n”;
getch();
return 0;
}
|
(If I didn't enter the code correctly for the Forum, please also tell me how to do that, this is my first post
--------------------------------------------------
Basically I just want to know what is wrong with the code and how I could fix it, because I have no clue.
Thanks in advance!