[Solved] C Programming Language #Project 3

$25

File Name: C_Programming_Language_#Project__3.zip
File Size: 320.28 KB

SKU: [Solved] C Programming Language #Project – 3 Category: Tag:
5/5 - (1 vote)

Part 1. Write a complete program implementing a simple calculator program. The calculator should have the usual binary operators: addition (+), substraction (-), multiplication (*), division (/), power (**) and modulo (%). The users of the program enter the operation they want to carry out in prefix notation.For example, the following input

+ 10 2

adds 10 and 2 returning 12. If the operator has only one argument, it takes the result of the previous operation as the first argument. If there is no previous operation (e.g., at the very beginning), 0 will be used.

An example run of the program follows:

+ 10 2

12

** 8 2

64 / 2

32 *

10

320 %

10 0

+ 10

10

8

2

You are additionally asked to define and use a function called doit. This function accepts three arguments: a function to represent the desired operator and two integer inputs. You are not allowed to apply the operator directly. This will require you to define at least 7 functions in your code and also menu function . Example use of doit function is given below:

int add(number1, number2); int sub(number1, number2);

doit (add, first_number, second number); doit (sub, first_number, second_number);

Part 2. Write a program that takes three arrays. The size of the first array should be 10 and it has to include homework grades. The size of the second array should be 10 and it has to include lab grades. The size of the third array should be 2 and it represents midterm and final grades. The grades will be taken from the user and will be assigned to the each cell of the arrays. Firstly you should calculate the average of the lab and homework grades, seperately. Then you should calculate the weighted average all of grades. To calculate the weighted average, you should take 10% of the average homework grade, 20%of the average lab grade, 30% of the midterm grade and %40 of the final grade. You should use these functions;

Page 1 of 3

int take_grades(int [] ); int take_exam_grades(int[]); double calculate_homework (int[]); double calculate_lab(int[]);

double calculate_all(int ,int[],int);

Part 3. In this part , you should take height of the shape from user. For example user enters the height number x, will press * character twice. Then should add 4 times and 6 times until the number of * will be (x-1)2. A triangle must be created from the combination of stars, triangle should be surrounded by the shape of / , characters. After the first triangle formed by expanding towards the bottom, the second triangle should be narrowing towards the bottom. Shapes must be look like that;

Output Example:

Page 2 of 3

Page 3 of 3

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.

Shopping Cart
[Solved] C Programming Language #Project 3
$25