Single-dimensional arrays

Assignment Help C/C++ Programming
Reference no: EM132399557

CSE 1321L: Programming and Problem Solving Lab

Lab - Single-Dimensional Arrays

Exercise #1: Design and implement a program (name it AssignGrades) that stores and processes numeric scores for a class. The program prompts the users to enter the class size (number of students) to create a single-dimensional array of that size to store the scores. The program prompts the user to enter a valid integer score (between 0 and 100) for each student. The program validates entered scores, rejects invalid scores, and stores only valid scores in the array.

The program defines method printGrades() that takes a signal-dimensional array of integer scores as a parameter and processes the scores to print letter grades based on the following scale:

Grade is A if score >= 90 and score <= 100
Grade is B if score >= 80 and score <= 89
Grade is C if score >= 70 and score <= 79
Grade is D if score >= 60 and score <= 69
Grade is F if score < 60

Exercise #2: Design and implement a program (name it CompareArrays) that compares the content of 2 single-dimensional arrays of the same size. The program prompts the users to enter the array size. Then prompts the user to initialize each array with integer values. The program defines method Compare() that takes two signal-dimensional arrays of type integer. The method compares the content of the arrays and returns true (Boolean type) if the arrays store same values in the same order. Otherwise, it returns false. The program main method calls method Compare()and prints the result from the method as shown below. Document your code and organized your output following these sample runs.

Exercise #3: Design and implement a program (name it ArrayMethods), that defines 4 methods as follows:

int arrayMax(int[] arr) returns the maximum value in the an array
int arrayMin(int[] arr) returns the minimum value in an array
void arraySquared(int[] arr) changes every value in the array to its square (value²)
void arrayReverse(int[] arr) reverses the array (for example: array storing 7 8 9 becomes 9 8 7 )

The program main method creates a single-dimensional array of length 5 elements and initialize it with random integers between 1 and 100. The program displays the original array, then calls each of the above methods and displays their results as shown below. Document your code and organized your output following these sample runs.

Attachment:- Single-Dimensional Arrays.rar

Verified Expert

The task of the program is to develop 3 C# programs.The program 1 requires to determine the grade of the student based on the score.The program 2 requires to determine whether the two array is identical or not. The program 3 requires to determine maximum and minimum of all value in array. The code is well commented and documented.

Reference no: EM132399557

Questions Cloud

How is ethical behavior integral part of being nurse leader : Choose one provision from the ANA Code of Ethics. How is ethical behavior an integral part of being a nurse leader? How does one display the characteristics.
Determine the variables that can be included in the study : A nurse has decided to research the following PICOT question: "Adult clients who are admitted to the cardiac unit with congestive heart failure are more likely.
What potential ethical and legal liabilities are there : What potential ethical and legal liabilities are there for the hospital and employees in the case presented above? In 2007, Harvard University rescinded.
Examine regulatory and legal requirements for the state : Examine regulatory and legal requirements for the state in which you plan to practice/work. Describe the professional organizations available for membership.
Single-dimensional arrays : Single-Dimensional Arrays - Design and implement a program and creates a single-dimensional array of length 5 elements and initialize.
Describe the steps to implement the proposed strategy : Implementation: Describe the steps to implement the proposed strategy in your selected health care organization. Challenges: Predict obstacles the health.
How can a single agreed model of terminology use : What do you believe are the advantages and disadvantages of having a single shared consensus-driven model of terminology use? How can a single agreed model.
Explain how you balance the ethical and legal risk : Explain how you balance the ethical and legal risk of going against the FCPA with the risk of losing business by not following a culture's business rules.
Discuss the role of a business plan in obtaining funding : Discuss the role of a business plan in obtaining funding. What fees might be associated with loan money?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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