Saturday, February 16, 2008

Find the error

Fill in the blanks in the following code

include _______________

using namespace std;

int __________
{
int mark;

________________________
cin >> mark;

if (mark >= 80)
cout << "Grade is A";
______________
if (mark >= 70)
cout << "Grade is B";
_______________
if (mark >= 60)
cout << "Grade is C";
_________________
if (mark >= 50)
cout << "Grade is D";
__________________
________________

System("pause");

______________
}

Write the code for the following

Example 1
The price of a airline ticket varies:
1st class is 5 times economy price
Business class is 3 times economy price
Econony class is determined by the destination
Seat sale ticket are 60% of economy ticket

Assuming that the type of ticket is given by user
and the economy price is given by another user

write a program to determine the price of a ticket.

Tuesday, February 12, 2008

Input / Output

Why are inputs necessary?

When writing a program, why is inputs needed?
How can inputs be collected?
What is done to the inputs when it is collected?

Who or what give inputs?
Who or what uses inputs?


Why are outputs necessary?

When writing a program, why is outputs needed?
How can outputs be given?
What is done to the outputs when it is given?

Who or what give outputs?
Who or what uses outputs?

Programming Language

What should be expected from this language, a programming language?

What is a syntax in a programming language?

How can a programming language talk to the computer?

Algorithm

What is an algorithm?

Give some examples?

How does a computer know what it should do? Explain.

Can an algorithm be tested? Explain.

A language

What is a language?

Is it necessary to have more than one language?

What are some of the main characteristics of a language?

What makes the presentation of the language more appealing to read?

Does lawyers have their own language? Explain.