prince_sasa
11-05-2009, 07:10 PM
Hello All
i hope anyone here knows C well
i am in engineering faculty Computer department
so i am learning C at first 5 weeks and honestly i can't understand a single word from Professors
so i will post my sheet that i must answer and you try to solve it and the MOST important thing is to explain quite bit the solution
here are 7 problems
please help me in sloving them or at least couple of them
please don't forget to explain , consider me that i have 0% experience with C
1. Write a program that given the an integer N, draws a triangale having a base and a
height equals N. For example a triangle with base and height 4 will look like
*
**
***
****
2. Write a program that given an array of N integers, output the maximum number, the
minimum number and the average and sum of these numbers.
3. Write a program that given two integer numbers x ,y and z, displays all the numbers
that are divisible by z in the range between x and y inclusively. Note that x is not
necessary less than y.
4. A factory divides its workers into three skill levels. Unskilled workers receive L.E. 8.15
per hour, semiskilled workers receive L.E. 12.55 an hour, and skilled workers L.E. 18.60
an hour. Write a program to calculate a workers weekly pay formatted to two decimal
places. Your program input should consist of the hours worked and a skill level
indicator. The program should run until the user enters two zeros, then the sum of all
wages should be displayed.
5. A shop need to keep an inventory of its 100 items for sale. Write a program that uses
paralled arrays to input the item code, price and quantity of each item. Then the
program displays a neat table of all items whose price > 100 pounds. Then it displays
another table of all items whose quantity is less than 10 items.
6. Write a program that calculates how far a satellite travels in one rotation about the
earth, given the satellites altitude in kilometers. Use 6365 km as the earths radius.
7. Write a function called calculator that accepts two numbers and an operation ( + - * /
) of type char. The function body executes the operation and returns the result.
Thanks in advance for all people who will help me
i hope anyone here knows C well
i am in engineering faculty Computer department
so i am learning C at first 5 weeks and honestly i can't understand a single word from Professors
so i will post my sheet that i must answer and you try to solve it and the MOST important thing is to explain quite bit the solution
here are 7 problems
please help me in sloving them or at least couple of them
please don't forget to explain , consider me that i have 0% experience with C
1. Write a program that given the an integer N, draws a triangale having a base and a
height equals N. For example a triangle with base and height 4 will look like
*
**
***
****
2. Write a program that given an array of N integers, output the maximum number, the
minimum number and the average and sum of these numbers.
3. Write a program that given two integer numbers x ,y and z, displays all the numbers
that are divisible by z in the range between x and y inclusively. Note that x is not
necessary less than y.
4. A factory divides its workers into three skill levels. Unskilled workers receive L.E. 8.15
per hour, semiskilled workers receive L.E. 12.55 an hour, and skilled workers L.E. 18.60
an hour. Write a program to calculate a workers weekly pay formatted to two decimal
places. Your program input should consist of the hours worked and a skill level
indicator. The program should run until the user enters two zeros, then the sum of all
wages should be displayed.
5. A shop need to keep an inventory of its 100 items for sale. Write a program that uses
paralled arrays to input the item code, price and quantity of each item. Then the
program displays a neat table of all items whose price > 100 pounds. Then it displays
another table of all items whose quantity is less than 10 items.
6. Write a program that calculates how far a satellite travels in one rotation about the
earth, given the satellites altitude in kilometers. Use 6365 km as the earths radius.
7. Write a function called calculator that accepts two numbers and an operation ( + - * /
) of type char. The function body executes the operation and returns the result.
Thanks in advance for all people who will help me
