Need Help with this Question or something similar to this? We got you! Just fill out the order form (follow the link below), and your paper will be assigned to an expert to help you ASAP.
CS 159 – Weekly Assessment 2 – Spring 2020
Upload the “.c” file on Moodle through the Weekly Assessment 2 submission link.
Part 1: Weekly Assessment for class.
Part 2: Weekly Assessment for lab.
Weekly Assessment 2 (Weight 15%) should be done individually.
Deadline: 12/05/2020
Write a C program to keep records and perform statistical analysis for a car sales agency. The
information of each car contains the number of the doors, the cylinder, and the width. Note that
you cannot use nested loops in the program. We consider in the program three one-dimensional
arrays named as follows:
1. door: An array to save the number of doors for each car.
2. cylinder: An array to save the number of the cylinders of each car.
3. width: An array to save the car width.
The size of all arrays used in the program is 5. Consider the constant SIZE with value equal to 5.
The values of the arrays’ elements (door[i], cylinder[i] and width[i]) represent the car’s
information with car ID’s equal to the value of the index “i”.
Part 1:
1. Write a function M_PrintArray_04 that takes an array of integers with size equal to SIZE and
prints all array’s elements horizontally centered in the screen. This function should not print
elements with value equal to -1 as shown in the example below. (15 points)
Example: If the array contains: [2, 4, 1, -1, -1], the function should print the following:
The array’s elements: 2 4 1
2. Write a function M_Max_width_04 that takes three arrays (door, cylinder and width) as formal
parameters and then prints the cars’ information of the longest car(s). It could be more than
one car. For example, if we have 3 cars with widths 2.2 (id =0), 2 (id =1) and 2.2 (id =2), this
function should print the values of 2 cars with id = 0 and id =2. (20 points)
3. Write a function M_Count_doors_04 that takes a one dimensional array (door) as formal
parameter and then calculates and returns the number of occurrence of the value 3 in the
array door. (10 points)
Part 2:
4. Write a function M_DrawRectangle_04 that displays the below rectangle (row = 5 and column
= 10) horizontally centered in the screen by using a for loop as shown in figure 1. (25 points)
P a g e | 2
Figure 1 Rectangle horizontally centered in the screen
5. Write a main function that does the following: (30 points)
– Define and initialize three one-dimensional arrays named door, cylinder and width with the
value -1. The value -1 means that the agency didn’t have any car yet.
– Prompt the user to enter all cars’ information (door, cylinder and width) until user enter EOF.
When the user enters EOF, the main function should stop reading and assign -1 to the
remaining elements of all arrays. Note that the user should enter 3 values for each car. If the
user enters successfully one or two values terminated by EOF for a car, the program should
assign -1 to all elements of this car and stop the reading from the standard input.
– Display the sample output below by calling the following functions: M_PrintArray_04,
M_Min_width_04, M_Count_cylinder_04 and M_DrawRectangle_04.
How to create Testimonial Carousel using Bootstrap5
Clients' Reviews about Our Services
Client ID 45637
U.S.A
Brilliant services. I ordered a 4 page essay and it was delivered in less than 24hours with every detail intact!
Client ID 45783
U.K
Aceassignment is the way to go. The writers are humble and patient with clients. I know this after using the website for about an year
Client ID 45214
U.K
My writer did a brilliant job. Not only did she delivered the paper on time and it was superb as my professor granted me an A without any criticism
Client ID 45009
CAD
I was running late with my assignment. I run into aceassignment on google, placed my order and within less than 18 hours my page essay was delivered. Thank you Aceassignment.
Client ID 45870
U.S.A
I've been using Aceassignment for about 2 years. My writer always delivers quality work. Mind you whenever I request for a revision it's always done ASAP and free of charge
Client ID 44218
U.S.A
At first, I was scared and hesitant about using this website. Didn't know if they would deliver, but they assured me they will. And for sure they did. I will definitely continue to use their service!
Client ID 45622
U.S.A
Easy to use website. You simply give your essay's instructions, make payment and before you known it the paper is delivered to you.
Client ID 43964
U.S.A
Unlike other platforms, this website is quite cheap and the quality is high. I have them manage my whole class and everything has been smooth this far.
Client ID 41996
U.K
Thanks for the excellent job. Swift and on the subject, just the way I like it. The Support team was quite nice to me, helped me with the order placing process.
Client ID 47654
AU
They are a marvel. I love their support team, they are so polite, it’s like speaking to a butler or something. Very pleasant people and good service of course.
Client ID 45670
FRA
Thank you for the help, I took my time and ordered a 14 days long essay. It came much earlier, around 7 days after I ordered it. Oh, and it was good, of course. I like the writer who did that, will definitely use again.
Client ID 22368
US
What I received was great. I forgot to mention in the instructions field that I needed reference page and by default, there was 0 in the number of references. I was surprised to see a full-fledged reference page in my paper with relevant citations. Bravo!
Client ID 46325
U.S.A
I was bombarding him with fine tuning and he handled it professionally. Thank you I will hire again the writer
Client ID 456820
U.S.A
Provided exceptional essay writing help in a short period of time. I plan to work with writer on many more projects!
Client ID 36890
UAE
Awesome paper in such a short amount of time. Was in a jam with another service who didn't deliver, but my writer did the job correctly. I will use her again to do my essays for sure!
Client ID 41427
U.K
Pretty good essay writer. I only made a couple of adjustments. She caught some instructions for the essay writing assignment that I didn't even notice, including them which was a pleasant surprise. Definitely recommend.
Client ID 45009
CAD
It was a very long paper, but the writer followed all the instructions, and she even finished the paper 5 days before the due date. Will write an essay with her again, thanks!
Client ID 36984
U.S.A
Writer was timely and proficient. I had to ask for a revision, but I got it back quickly with no other issues. Would use this essay writing service again.
Client ID 42960
CAD
Paper writing was prepared and submitted prior to the completed request date, and there were changes made quickly after I requested. This paper writer was accurate with numbers.
Client ID 31638
U.K
The first time I ordered here and it was a success. I received my order on time and according to my instructions. Thank you!
Client ID 46041
CAD
When I first discovered this website I was hesitant on whether they will deliver a plag free paper. The support team reassured me of their plagiarism policy. In deed they kept their word as the paper I got was authentic and plagiarism free.