EE 590 B (PMP): Numerical Methods for Electrical Engineering Programming Assignment 3 – Introduction to C Programming Language
Assigned: Thursday, December 8, 2016, Due: Thursday, December 15, 2016
Instructor: Tamara Bonaci
Department of Electrical Engineering University of Washington, Seattle
What to submit: Your submission should consist of five separate files with extension .c - one for each programming assignment. To get a full credit on this programming assignment, you need to make sure that you submitted program compiles (using a standard gcc compiler) without any errors1. Please do not submit your executable files.
This programming assignment is due by 11:59pm on Thursday, December 15, 2016.
Problem 1 Write a program in C that takes as input five scores for five different assignments, and prints out the total score, the average score, and the percentage across all assignments.
Example: If we input the following score for five assignments: 95 76 85 90 89, then our program should print out:
Output total = 435
Average = 87
Percentage = 87.00
Problem 2 Write a C program to find maximum number between three numbers.
Example: If we input number 10, 50 and 120, our program should print out: Output maximum: 120.
Problem 3 Write a C program that reads an integer from a user, and counts (prints out) the total number of digits that the integer contains.
Example: If we input integer 35419, then our program should print out: The given number consists of 5 digits.
Problem 4 Write a C program that reads elements in an array, and then prints all negative elements. Assume that the maximum size of an array is 100.
Example: If we input an array [-1, -10, 100, 5, 61, -2, -23, 8, -90, 51], then our program should print out -1, -10, -2, -23, -90.
Problem 5 Write a C program to concatenate two different strings into single string. In doing so, assume that no input string will be longer than 10 characters.
Example: If we use strings Good and luck! as our input strings 1 and 2, respectively, then our program should print out Good luck!.
1 That means that you might need to be mindful about the text editor that you are using, and the encoding that it uses.