CSE102 – Solved

$ 29.99
Category:

Description

Homework #2(Updated)
Grading: This homework will be graded on a scale of 100.

Description: In this homework, you will write a complete C program that implements several functions as described below. You are expected to reflect on what you have learned in class up to this point.
You are provided with four separate files (in HW2_Src.rar):
• hw2_lib.c: This file will contain your implementation of the functions declared in the associated header file. The details of the behavior of these functions are provided below. • makefile: This is a makefile provided for you to use for compiling and testing your code.
The following provides the details of the functions to be implemented:

• double find_angle (double a, double b, double c): Gets three real numbers as argument representing the length of the edges a, b and c as shown in the figure below. It calculates the angle shown as α in the figure in radians.

a

• void print_tabulated (unsigned int r11, double r12, int r13, unsigned int r21, double r22, int r23, unsigned int r31, double r32, int r33, char border): You are expected to write a function that tabulates a given set of numbers in several different formats. The table has three columns and four rows including the header row.
o The header row has the following centered titles: “Row 101”, “Row ABCDEFG” and “Row XYZ123”.
o The first column is positive integer numbers printed centered. We expect that these numbers not to exceed 5 digits.
o The second column holds double numbers aligned to the left with 2 decimal digits without trailing zeros. It should not have leading zeros either.
o The third column is signed integers printed left-aligned. You can assume that the numbers in this column cannot exceed 6 digits including the sign character.
o The borders of the table (i.e., lines) can be drawn with ‘*’ or ‘-‘. In the latter case, the vertical lines should use the ‘|’ character and corners should use the right cornered characters.
Useful Hints: Here are some things that might make your development a bit easier.
• For testing your code use files for inputting data and getting the output. For example:
$ hw2 < input.txt > output.txt will get the input from the file “input.txt” and will write the output to the file “output.txt”. This way you can easily make a lot of entries to test your code without using the keyboard again and again.
• Use the makefile to compile your code. You can add a run case to your makefile to do the compilation and testing with one simple make command.
What to hand in: You are expected to hand in a .zip or .rar file including your implementation in “hw2_lib.c”.
• HW2_lastname_firstname_studentno.rar / HW2_lastname_firstname_studentno.zip

Reviews

There are no reviews yet.

Be the first to review “CSE102 – Solved”

Your email address will not be published. Required fields are marked *