Need Emergency Really Beginner Help !

Hello all , i'm a first year computer engineer student and have an exam tomorrow. The teacher gave us some practice questions for the exams.. Can someone help me ? I need the source codes of programs required in the questions.. If someone can give me source code , i can understand how the program goes..

QUESTION 1
 Suppose that you are asked to develop a cell phone
invoice calculator program.
 There are two types of tariffs for users:
 (1) the users that do not use any package are charged
0.15 TL/6 seconds
 (2) the 'eco' package users will pay 19 TL fixed fee for
first 50 minutes and 0.2 TL/6 seconds for extra
talking time that exceeds 50 minutes
 The program will get the total number of talking time
in terms of minutes (double type) and then calculate
and print the total amount that the user will pay for
each tariff type.
 Write the C++ source code of the above
program.

QUESTION 2
Write for and do-while structures
to compute the following products.
1 x (1 / 3) x (1 / 5) x ….x (1 / (n/2))
where n is an integer entered by the
user.

QUESTION 3
Write a C++ program that
gets a positive integer from
the user. The number will be
required until a positive
number is entered.
Find and print the factors of
the entered number.

QUESTION 4

Explain what program is this source code :

#include<iostream>
int main()
{ int i,j,k,n;
cout << “How many rows?” << endl;
cin >> n;
for(i=n; i>0; i=i - 2)
{
cout << endl;
for(k=(i+1)/2; k>0; --k)
cout << “ “;
for(j=1;j <= i; ++j)
cout << “ &”;
}
}

QUESTION 5
Write a C++ program that checks
if an entered number is prime or
not.

QUESTION 6
Write a C++ program that prints
the prime numbers between 2 and
10000.

QUESTION 7
 The value of π can be approximated by using the
following series:
http://i.imgur.com/L9I7bv0.png

 Write a program that gets the value of n as a
parameter and returns the estimated value of π.

QUESTION 8
 Let n = akak-1ak-2. . .a1a0 be an.
 Find and display the sum of digits of n
(ak + ak-1 + ak-2 + …………… + a1 + a0)
 The number n will be entered by the user

QUESTION 9
 The population of a town A is less than the
population of town B.
 However, the population of town A is growing
faster than the population of town B.
 Write a program that prompts the user to enter
the population and growth rate of each town. The
program outputs after how many years the
population of town A will be greater than or
equal to the population of town B and the
populations of both the towns at that time.

QUESTION 10
 Write a program that gets 10 elements from the
user and displays the minimum.

QUESTION 11
 Write a program that gets an integer, say n, by
the user.
 The program than will get positive elements by
the user until 0 is entered.
 When 0 is entered, the program will display the
position of the last occurance of n.

QUESTION 12
Write a program that gets a
number from the user and
finds the sum of the prime
numbers in its digits.



I know i want too much things but i really need help :/
Last edited on
well , what did i do wrong? I didn't post homework questions :S
Topic archived. No new replies allowed.