Make three arrays of 20 integers each

Assignment Help Computer Engineering
Reference no: EM1331621

1. Create three arrays of 20 integers each. Fill in two arrays with data, leaving the third blank. From main, pass these three arrays into a function. Inside the function, add the value of each array element and store it in the third.
third_array[i] = second_array[i] + first_array[i]

Back in main, print out the value of every element in the third/sum array. Excellent output on this assignment might show something like:
Array 1 + Array 2 = Array 3
5 + 3 = 8
10 + 4 = 14
etc.

2. Design and run a program that takes a numerical score and outputs a letter grade. Specific numerical scores and letter grades are listed below:
90-100 = Grade A
80-89 = Grade B
70-79 = Grade C
60-69 = Grade D
0-59 = Grade F

In this program, create two void functions titled getScore and printGrade with an int argument. The function getScore should have a Reference parameter and printGrade should have a Value parameter.

The function getScore will prompt the user for the numerical score, get the input from the user, and print the numerical score. The function printGrade will calculate the course grade and print the course grade. (Be careful and note that the assignment requires you to input the grade into getScore and not directly into the main function.)

Do not forget to put in the proper prompts and appropriate output messages. (Note: This program is a natural for use of the switch command, but if?else structures will also work.)

3. Write a program that includes the following four steps:
Step 1.Create a structure with the name StudentRecord containing a Name stored as an array of 20 characters, an ID stored as an integer, and a GPA stored as a floating-point number. Create (instantiate) a variable from StudentRecord called TESCStudent.

Step 2. Assign the following values to the variable by assuming Name is SuperProgrammer, with an ID of 1234, and a GPA of 4.0.

Step 3. The program should print out on the screen that SuperProgrammer with an Identification number of 1234 has a 4.0 GPA. (Of course, your program needs to use the structure you defined in step 1.)

Step 4. Generalize the program so that you can input the student's name, ID, and GPA when the program is run. Please do not forget to include prompt statements in your program. Print out the user entered Name, ID, and GPA.

Make sure your program includes all four steps, not just steps 1 and 4.

4. Define a class called Plot that has private members of length and width. Include a constructor and a public function that calculates the area and the length of the boundary of the field. Use public functions in a program that computes and displays the area and the length of the boundary of the plot where the length and width are 7 and 9 respectively. Hint: The length of the boundary is 2 * (length + width).

Reference no: EM1331621

Questions Cloud

The collapse of centrally planned economies : Discuss the four factors that contributed to the collapse of centrally planned economies.
Describe examples of ethical problems : Health care providers are obligated to provide for those entrusted in their care. To what extent do they meet this obligation? How might their obligation to others conflict with their obligation to themselves?
Reduce the risk of loss from natural or unnatural disasters : What should a company do to make sure their data is in enough disperse locales to reduce the risk of loss from natural or unnatural disasters?
Difference between a forensic accountant and an auditor : What is the difference between a forensic accountant and an auditor? What do they have in common and what do they do that is different from each other?
Make three arrays of 20 integers each : Create 3 arrays of 20 integers each. Fill in two arrays with data, leaving the third blank. From main, pass these three arrays into a function. Inside the function, add value of each array element and store it in the third.
Describe the maximum insurance premium : Describe the maximum insurance premium that the individual is prepared to pay.
Compute utility function that corresponds to a constant : Compute utility function that corresponds to a constant Arrow-Pratt measure of absolute risk-aversion.
Find the primary assets held by the company : Using Target Corporation's 2010 Annual Report, Find the primary assets held by the company?
Make use of a stack for the infix to postfix conversion : comprise a README file describing how to run your program and give an example.make Use of a stack for the infix to postfix conversion.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Design a dedicated datapath

Design a dedicated datapath

  Creating the program

Develop a class named Book which holds a stock number, title, author, price, and the number of pages for a book. Involve a method which sets all the data files and another which prints the values for each data field.

  Write a java program that uses a two-dimensional array

Write a Java program that uses a two-dimensional array

  What required to happen in order for the database

If the computers of organization are to old, the database management system might not be installed in the organization and will not run properly or sometimes not at all. This information is good to remember as planning a particular database implem..

  How to write a class template sortablevector

how to Write a class template SortableVector. The class should have a member function that sorts the vector elements in ascending order (your choice of the sorting method).

  Prepare a multithreaded code breaking program

Prepare a  multithreaded code breaking program. You have been provided 3 files that contain text that have been  encrypted using a Caeser cypher scheme.

  Why it professionals to consider project cost management

Why is it important for the IT professionals to consider project cost management? What might be the result if IT professionals were to overlook this aspect of their projects.

  Program with a function that returns a random integer

Program with a function that returns a random integer

  Main differences between selection and switch structure

What do you need to analyze when directing flow of information in each case? Give code examples for if/else structure and switch structure that produce the same result.

  What is best-case complexity of the algorithm

What is best-case complexity of the algorithm?

  Information security

What skills are required by personnel working in the information security? State some job titles in field and come up with some required qualifications and some desirable qualifications.

  Left most derivation

A->a|aS|bAA, B->b|bS|aBB, For the string “aaabbabbba” determine a Left most derivation.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd