Skip to content

Latest commit

 

History

History
76 lines (63 loc) · 3.17 KB

File metadata and controls

76 lines (63 loc) · 3.17 KB

CSE102_Homeworks_2014-2015

C Programming homeworks.

HW0

Code examination.

HW1

Part 1:

  • C program which evaluates the fog(x) and gof(x) using the following functions for some user defined integer x.

Part 2:

  • C program which finds x and y using the following linear equations with two unknowns and calculates f (x,y).

Part 3:

  • C program which reads car information from an input text file named as ‘Cars.txt’ and output total fuel cost.

HW2

Part 1:

  • C program for “Guessing An Integer Number” game.

Part 2:

  • C program that calculates letter grade of 5 students.

HW3

Part 1:

  • C program for “Guessing An Integer Number” game. The game is same with the first question of Hw2. But in this homework, you will continue to guess until you guess the correct number.

Part 2:

  • C program for “Evaluating the vertical distance of the bouncing ball”.

HW4

Encryption and Decryption. See the pdf file.

HW5

Part 1:

  • Implementation of a car crash simulator program. There will be two cars. You will get car names as character, car speeds as double, and car weights as integer from console.

Part 2:

  • C program that provides the following output values using the following input values(in the pdf file).

HW6

Part 1:

  • C program for job assignment problem.

Part 2:

  • C program for “checking the Major and Minor Vowel Harmony and making a noun Plural”.

HW7

  • You will write a recursive function that finds and returns size of a string.

int find_size(const char *string)

  • Using the function above write a new function that finds how many times a given string is used in a given string.

int char_number(const char *string, const char *wish_to_find)

  • Assume every Friday, you have to climb n stairs for C lab on the first floor. You can take your steps as follow: One stair at a time or two stairs at a time. You will write a complete C program to calculate in how many distinct ways you can climb to the top and to print it on the screen.

Your program will include at least two functions as following :

  • int combination (int n , int k) : a recursive function to calculate combination “n choose k” and returns the result.
  • int ways (int n) : write a recursive function to calculate and return total number of ways.

HW8

Part 2:

  • C program to handle the appointments of a doctor. Check the pdf for further information.

HW9

Part 1:

  • University worker implementation. Structs are used.

Part 2:

  • Complex numbers library.

Part 3:

  • Implementation of MPN method.

HW10

Implementation of a simple program to process some appointment data of some patients. All appointments start at the beginning of an hour. Basically, code:

  • Read some appointment records from a records file (binary file) into a dynamically allocated array (Part1),
  • Build a linked-list holding the valid appointment records in this array (Part 2),
  • Handle the following operations on the link-list :
  • Adding patient history, taken from the patients file (text file), to each appointment in the list (Part 2),
  • Deleting a list of canceled appointments, taken from a delete file (text file) (Part 2),
  • Deallocating the dynamic data (Part 2),
  • Making an independent copy of the list (Part 3).