- Joined
- Sep 15, 2009
- Messages
- 2,076 (0.39/day)
System Name | Omen |
---|---|
Processor | i7-4710HQ |
Cooling | Dual fan/heatpipe |
Memory | 16GB |
Video Card(s) | 4GB GTX 860M |
Storage | 256GB PCIE SSD/256GB PNY UHS-1 SD Card |
Display(s) | 15.6' 1080P |
Case | Aluminium |
Audio Device(s) | Onboard |
Power Supply | Brick |
Software | Win 10 |
Hi guys. At school we just started some pascal programming and our teacher has told us to try do it on our own at first. I'm 15 and have no background in programming. These are some questions we were given.
All to be done with pascal! In bold is what I have done.
1 The program should ask for the user’s personal details, including fi rst name, family name, birth date, favourite singer, favourite movie actor, then display details on the screen like this:
First name:
Family name:
Birth date:
Favourite singer:
Favourite movie actor:
(Have not answered this yet)
1 Write an assignment statement that assigns your own name to a string variable and prints out the message ‘Hello, yourname!’
VAR
fname : string;
Write(“What is your name?”);
Readln (fname);
Write (“Hello “ ,fname, “!”)
2 Write an assignment statement that assigns the first letter of both your first and second names to character variables and then prints out a greeting using your initials only: ‘Hello, XX!’
VAR
fname: string;
sname: string;
Write(“What is you first and last name?”);
Read
This is where I am confused.
And this I have not yet gotten up to.
3 Write an assignment statement that assigns your birth date to a date variable. Next write a function which calculates the number of days that have passed from the birthdate to the present and finally prints out the
message ‘Hello, your name! You are xx days old!’
And help would be greatly appreciated!
All to be done with pascal! In bold is what I have done.
1 The program should ask for the user’s personal details, including fi rst name, family name, birth date, favourite singer, favourite movie actor, then display details on the screen like this:
First name:
Family name:
Birth date:
Favourite singer:
Favourite movie actor:
(Have not answered this yet)
1 Write an assignment statement that assigns your own name to a string variable and prints out the message ‘Hello, yourname!’
VAR
fname : string;
Write(“What is your name?”);
Readln (fname);
Write (“Hello “ ,fname, “!”)
2 Write an assignment statement that assigns the first letter of both your first and second names to character variables and then prints out a greeting using your initials only: ‘Hello, XX!’
VAR
fname: string;
sname: string;
Write(“What is you first and last name?”);
Read
This is where I am confused.
And this I have not yet gotten up to.
3 Write an assignment statement that assigns your birth date to a date variable. Next write a function which calculates the number of days that have passed from the birthdate to the present and finally prints out the
message ‘Hello, your name! You are xx days old!’
And help would be greatly appreciated!