CE150 Introduction to programming with C

$20 Bonus + 25% OFF

Securing Higher Grades Costing Your Pocket?
Book Your Assignment at The Lowest Price
Now!

Students Who Viewed This Also Studied

CE150 Introduction to programming with C

Question:

Instructions: You must submit a with your code for each of the following exercises which can be compiled and run successfully. Your code must include comments which explain what your code is doing. You do not need to submit any other files explaining your code. You will lose marks if you do not follow these instructions, i.e., if you do not submit a .c file per exercise, if your code does not compile successfully, and if you do not include sufficiently enough comments.

The questions in each exercise are worth equally.

The goal of this exercise is to write a program that processes arrays and matrices. The material of units 4 and 5 will be very useful.

Your program must include the following:

(a) A function with prototype

This function takes as input an array x of n integers and checks if it is sorted in the order defined by the mode string (increasing or decreasing). It returns 1 if this is indeed the case, and 0 otherwise. The mode string can only be equal to “increasing” or “decreasing”. If none of these two strings are given as input for mode, the function must print an error message “Incorrect sorting mode” and return -1. Use appropriate functions from string.h to check the value of the mode string.

(b) A function with prototype

The first three parameters z, x, y are integer pointers and correspond to arrays. The remaining two parameters n_x, n_y are integers and correspond to the sizes of x and y, respectively. The function first checks if x and y are sorted in increasing order by appropriately using the function is_sorted defined in (a); if any of them is not appropriately ordered, then the function and returns 0 (false). If both are sorted, then it merges their elements and stores them into z, so that the elements are all sorted in increasing order. Once this is done, it returns 1 to show that the operation was successful (true).

(c) A main function that does the following:

Asks the user to enter 15 non-negative integers in increasing order, which are stored in a 3 x 5 matrix named M. If at any point the user enters a negative number, this number must not be stored in M, and instead the user must be asked to re-enter this number; in other words, you need to check whether each given number is non-negative with a loop.

Once the numbers are given and are stored in M, by appropriately calling the function merge, the program merges the three rows of M into a single array named A with all 15 elements sorted. You can call the merge function with input the first two rows of M and store the outcome in an array named x of size 10; then you can again call the merge function again with input the third row of M and the array x, and store the outcome in array A (of size 15).

If the elements are not given in sorted order by the user, then the program must print an error message “Numbers not given in increasing order” and the program must terminate. You can check whether this has happened by appropriately checking the output of the merge each time that is called.

The goal of this exercise is to write a program that uses structuresto represent students and modules. The material of Units 5 and 6 will be very useful.

Your program must include the following

(a) A structure type named student. Variables of this type must have the following members:

  • a string firstname,
  • a string lastname,
  • and a float avg_grade.

(b) A function with prototype

This function takes as input a pointer to a student structure and asks the user to enter the name of the student. In particular, the function asks the user to enter the first name of the student which is stored in the member firstname of x and the last name of the student player which is stored in the member lastname of x. These strings must not include any spaces.

(c) A function with prototype

The input is an array x with the information of n students, and a matrix grade with their grades in 10 modules (in particular, grade[i][j] is the grade of student i for module j). The function computes the average grade of each student over all modules and stores this information in the avg_grade member of the corresponding structure. The average grade of a student is computed by summing all the grades of a student and dividing by the number of modules (in this case, 5).

(d) A main function which declares an array of 10 students and a 10 x 5 matrix that will store their grades for 5 modules.

  • By appropriately calling the function read_student defined in (b) it asks the user to enter the names of all students.
  • Then, it asks the user to enter the grades of each student, which are stored in the grade matrix (this is done within the main function).
  • By appropriately calling the function compute_avg defined in (c), the program calculates the average grades of all students.
  • Finally, it prints a list with the names of the students and the classification of their degree right next to their name as follows: First (if the average grade is at least 70), Upper second (if the average grade is between 60 and 70), Lower second (if the average grade is between 50 and 60), Third (if the average grade is between 40 and 50), or Fail (otherwise).

CE150 Introduction to programming with C

Answer in Detail


Solved by qualified expert

Get Access to This Answer

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst vestibulum rhoncus est pellentesque. Amet dictum sit amet justo donec enim diam vulputate ut. Neque convallis a cras semper auctor neque vitae. Elit at imperdiet dui accumsan. Nisl condimentum id venenatis a condimentum vitae sapien pellentesque. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Malesuada fames ac turpis egestas maecenas pharetra convallis posuere. Et ultrices neque ornare aenean euismod. Suscipit tellus mauris a diam maecenas sed enim. Potenti nullam ac tortor vitae purus faucibus ornare. Morbi tristique senectus et netus et malesuada. Morbi tristique senectus et netus et malesuada. Tellus pellentesque eu tincidunt tortor aliquam. Sit amet purus gravida quis blandit. Nec feugiat in fermentum posuere urna. Vel orci porta non pulvinar neque laoreet suspendisse interdum. Ultricies tristique nulla aliquet enim tortor at auctor urna. Orci sagittis eu volutpat odio facilisis mauris sit amet.

Tellus molestie nunc non blandit massa enim nec dui. Tellus molestie nunc non blandit massa enim nec dui. Ac tortor vitae purus faucibus ornare suspendisse sed nisi. Pharetra et ultrices neque ornare aenean euismod. Pretium viverra suspendisse potenti nullam ac tortor vitae. Morbi quis commodo odio aenean sed. At consectetur lorem donec massa sapien faucibus et. Nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Duis at tellus at urna condimentum mattis pellentesque. Vivamus at augue eget arcu dictum varius duis at. Justo donec enim diam vulputate ut. Blandit libero volutpat sed cras ornare arcu. Ac felis donec et odio pellentesque diam volutpat commodo. Convallis a cras semper auctor neque. Tempus iaculis urna id volutpat lacus. Tortor consequat id porta nibh.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst vestibulum rhoncus est pellentesque. Amet dictum sit amet justo donec enim diam vulputate ut. Neque convallis a cras semper auctor neque vitae. Elit at imperdiet dui accumsan. Nisl condimentum id venenatis a condimentum vitae sapien pellentesque. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Malesuada fames ac turpis egestas maecenas pharetra convallis posuere. Et ultrices neque ornare aenean euismod. Suscipit tellus mauris a diam maecenas sed enim. Potenti nullam ac tortor vitae purus faucibus ornare. Morbi tristique senectus et netus et malesuada. Morbi tristique senectus et netus et malesuada. Tellus pellentesque eu tincidunt tortor aliquam. Sit amet purus gravida quis blandit. Nec feugiat in fermentum posuere urna. Vel orci porta non pulvinar neque laoreet suspendisse interdum. Ultricies tristique nulla aliquet enim tortor at auctor urna. Orci sagittis eu volutpat odio facilisis mauris sit amet.

Tellus molestie nunc non blandit massa enim nec dui. Tellus molestie nunc non blandit massa enim nec dui. Ac tortor vitae purus faucibus ornare suspendisse sed nisi. Pharetra et ultrices neque ornare aenean euismod. Pretium viverra suspendisse potenti nullam ac tortor vitae. Morbi quis commodo odio aenean sed. At consectetur lorem donec massa sapien faucibus et. Nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Duis at tellus at urna condimentum mattis pellentesque. Vivamus at augue eget arcu dictum varius duis at. Justo donec enim diam vulputate ut. Blandit libero volutpat sed cras ornare arcu. Ac felis donec et odio pellentesque diam volutpat commodo. Convallis a cras semper auctor neque. Tempus iaculis urna id volutpat lacus. Tortor consequat id porta nibh.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Hac habitasse platea dictumst vestibulum rhoncus est pellentesque. Amet dictum sit amet justo donec enim diam vulputate ut. Neque convallis a cras semper auctor neque vitae. Elit at imperdiet dui accumsan. Nisl condimentum id venenatis a condimentum vitae sapien pellentesque. Imperdiet massa tincidunt nunc pulvinar sapien et ligula. Malesuada fames ac turpis egestas maecenas pharetra convallis posuere. Et ultrices neque ornare aenean euismod. Suscipit tellus mauris a diam maecenas sed enim. Potenti nullam ac tortor vitae purus faucibus ornare. Morbi tristique senectus et netus et malesuada. Morbi tristique senectus et netus et malesuada. Tellus pellentesque eu tincidunt tortor aliquam. Sit amet purus gravida quis blandit. Nec feugiat in fermentum posuere urna. Vel orci porta non pulvinar neque laoreet suspendisse interdum. Ultricies tristique nulla aliquet enim tortor at auctor urna. Orci sagittis eu volutpat odio facilisis mauris sit amet.

Tellus molestie nunc non blandit massa enim nec dui. Tellus molestie nunc non blandit massa enim nec dui. Ac tortor vitae purus faucibus ornare suspendisse sed nisi. Pharetra et ultrices neque ornare aenean euismod. Pretium viverra suspendisse potenti nullam ac tortor vitae. Morbi quis commodo odio aenean sed. At consectetur lorem donec massa sapien faucibus et. Nisi quis eleifend quam adipiscing vitae proin sagittis nisl rhoncus. Duis at tellus at urna condimentum mattis pellentesque. Vivamus at augue eget arcu dictum varius duis at. Justo donec enim diam vulputate ut. Blandit libero volutpat sed cras ornare arcu. Ac felis donec et odio pellentesque diam volutpat commodo. Convallis a cras semper auctor neque. Tempus iaculis urna id volutpat lacus. Tortor consequat id porta nibh.

25 More Pages to Come in This Document. Get access to the complete answer.

Quality assignment help and MyAssignmenthelp.com are synonymous terms. You can avail our online assignment help without worrying about the content’s originality. Our 3000+ PhD level experts refer to the most relevant sources while providing academic assignment help and always maintain an original writing style. Many students from nations like USA, UK and Australia avail assignment help services from us since they trust our authenticity. If you have any query regarding the assignment help material provided by us then it can be addressed through our 24/7 online chat support facility. Our brand is always ready to provide Turnitin report absolutely free for any assignment help material provided to you.

More CE150 CE150 Introduction to programming with C: Questions & Answers

ICTNWK602 Plan Configure And Test Advanced Server Based Security

Question:
Task:
First, download the ISO image of windows server 2016 and use it to create a VM using VMware or VBox. After you successfully installed Windows server 2016, install and configure DNS, DHCP, WEB, FTP, and firewall services. (this process does not need to be fully documented but ra …

View Answer

Management

Add the multiple-line simulation, one line per Teller.  You can do this in two completely different Banks if you prefer, but you may find that it is pretty simple to have a flag that you can flip to have your code process multiple queues.  They are very similar.  Rather than a single …

View Answer

159.234 Object-Oriented Programming

You are asked to write a C++ program that has the same display and search functionalities as the Java program you wrote for Assignment 2, the ‘Select’, ‘Borrow’, ‘Return’, and ‘Rate’ functions are NOT required. There are three types of items that can b …

View Answer

Structure And Algorithms

You can find all the places where you need to add your code through the Task (TODO)
panel.
1. In the Runner project, expects one parameter: numberOfVisitors. Do not enter too
many because the current implementation creates thread for each visitor. The rest
of the Runner project does not need to …

View Answer

Content Removal Request

If you are the original writer of this content and no longer wish to have your work published on Myassignmenthelp.com then please raise the
content removal request.

Choose Our Best Expert to Help You

Jaydon Key

research scholar in Columbia University and am pursuing my doctorate degree in Physics.

300 – Completed Orders

Hire Me

R. Baker

MSc with Specialization in Electrical Engineering

2019 – Completed Orders

Hire Me

Still in Two Minds? The Proof is in Numbers!

33845 Genuine Reviews With a Rating of 4.9/5.

Database

Thesis: 10 Pages, Deadline:
17 days

The assingment was very good, everything was explained very well.I scored very good marks.

User ID: 7***00 Australia

Assignment

Essay: 8 Pages, Deadline:
21 hours

I asked for 2000 words but the content provided was for 1840 words only. But still its was nice

User ID: 8***87 Australia

Management

Essay: 1 Page, Deadline:
3 days

Great job on assignment. I got an A and will use this expert again. Thank you for all your help!

User ID: 5***56 San Francisco, United States

Management

Assignment: 1.6 Pages, Deadline:
9 days

Excellent Expert. On time and helped get an A. Good job and keep up the good work. Will use again.

User ID: 5***56 San Francisco, United States

Networking

Programming: 7.2 Pages, Deadline:
8 days

It was good report and helped me get good grades. So, I always prefer my assignment help.

User ID: 5***32 Luton, Great Britain

Statistics

Programming: 1 Page, Deadline:
1 day

The quality of work was good. It was well made and complete. I haven’t received my grade yet but I hope that I get a good mark.

User ID: 8***38 Philippines

Maths

Home Work: 1 Page, Deadline:
1 day

good job! math structure is mention clearly and provided solution for each step.

User ID: 8***07 Malaysia

Chemistry

Home Work: 3 Pages, Deadline:
19 days

thanks to your efforts. It’s well researched and well written….I’d greatly appreciated .

User ID: 6***55 Canada

Finance

Course Work: 0.8 Pages, Deadline:
14 hours

Overall, I received a quality, detailed, and timely finished product. I was able to better understand the material after assistance with the assignmen …

User ID: 8***76 United States

Finance

Course Work: 2 Pages, Deadline:
1 day

Quality, detailed, and timely finished product. I was able to better understand the material after assistance with the assignment, and pass the course …

User ID: 8***76 United States

Database

Thesis: 10 Pages, Deadline:
17 days

The assingment was very good, everything was explained very well.I scored very good marks.

User ID: 7***00 Australia

Assignment

Essay: 8 Pages, Deadline:
21 hours

I asked for 2000 words but the content provided was for 1840 words only. But still its was nice

User ID: 8***87 Australia

Management

Essay: 1 Page, Deadline:
3 days

Great job on assignment. I got an A and will use this expert again. Thank you for all your help!

User ID: 5***56 San Francisco, United States

Management

Assignment: 1.6 Pages, Deadline:
9 days

Excellent Expert. On time and helped get an A. Good job and keep up the good work. Will use again.

User ID: 5***56 San Francisco, United States

Networking

Programming: 7.2 Pages, Deadline:
8 days

It was good report and helped me get good grades. So, I always prefer my assignment help.

User ID: 5***32 Luton, Great Britain

Statistics

Programming: 1 Page, Deadline:
1 day

The quality of work was good. It was well made and complete. I haven’t received my grade yet but I hope that I get a good mark.

User ID: 8***38 Philippines

Maths

Home Work: 1 Page, Deadline:
1 day

good job! math structure is mention clearly and provided solution for each step.

User ID: 8***07 Malaysia

Chemistry

Home Work: 3 Pages, Deadline:
19 days

thanks to your efforts. It’s well researched and well written….I’d greatly appreciated .

User ID: 6***55 Canada

Finance

Course Work: 0.8 Pages, Deadline:
14 hours

Overall, I received a quality, detailed, and timely finished product. I was able to better understand the material after assistance with the assignmen …

User ID: 8***76 United States

Finance

Course Work: 2 Pages, Deadline:
1 day

Quality, detailed, and timely finished product. I was able to better understand the material after assistance with the assignment, and pass the course …

User ID: 8***76 United States

Have any Query?
Reference no: EM132069492

WhatsApp
Hello! Need help with your assignments? We are here

GRAB 25% OFF YOUR ORDERS TODAY

X