Explain reverse, sort and binary search

Assignment Help Programming Languages
Reference no: EM13936045

Because an array is an object it must be declared using the new operator: int[ ] myarray = new int[5]; or it could be declared and initialized statically using the format

int[ ] myarray = {1, 3, 5, 7, 9};

Because the C# array is an object member of the Array class it also comes with a number of built-in methods such as Reverse, Sort and Binary Search. You can use the Reverse method

ACTUAL ASSIGNMENT REQUEST IS AS FOLLOWS:

[Assignment3_yourlastname.cs] Create a program that includes the following requirements:

1. Create an accounts class

2. Private class members for:

an array of 5 account numbers

an array of 5 account balances (currency)

an array of 5 account names (last name)

3. Public class methods:

a method to fill all three parallel arrays by keyboard inputs

a method to search the account number array and display

when found, the account number entered at the keyboard along with the corresponding balance and last name

if nothing is found for the account number entered display "You entered an invalid account" on the console

a method to compute and display the average of all 5 balances as currency (you must use the array's Length property at least once in this method)

4. In Main:

Instantiate one new accounts object

call the class method that will fill the accounts array

a menu detailing entries to select search (a or A), average (b or B) or exit (x or X)

accept an entry from the keyboard and use a while-loop to allow the user to make selections until an x or an X is entered

when an x or an X is entered terminate the while loop

5. Internal Documentation.

POSSIBLE OUTPUT SHOULD LOOK SOMETHING ALONG THE LINES OF THE FOLLOWING EXAMPLE:

Enter the integer account number 1

Enter the account balance 1111

Enter the account holder last name Stutte

Enter the integer account number 2

Enter the account balance 2222

Enter the account holder last name Stanton

Enter the integer account number 3

Enter the account balance 3333

Enter the account holder last name Staton

Enter the integer account number 4

Enter the account balance 4444

Enter the account holder last name Stiles

Enter the integer account number 5

Enter the account balance 5555

Enter the account holder last name Stone

*****************************************

enter an a or A to search account numbers

enter a b or B to average the accounts

enter an x or X to exit program

*****************************************

Enter an option ---> B

The average dollar amount for the accounts is: $3,333.00

*****************************************

enter an a or A to search account numbers

enter a b or B to average the accounts

enter an x or X to exit program

*****************************************

Enter an option ---> 4

you entered an incorrect option

*****************************************

enter an a or A to search account numbers

enter a b or B to average the accounts

enter an x or X to exit program

*****************************************

Enter an option ---> A

Enter an account number to search for 4

Account # 4 has a balance of $4,444.00 for customer Stiles

*****************************************

enter an a or A to search account numbers

enter a b or B to average the accounts

enter an x or X to exit program

*****************************************

Enter an option ---> X

Press any key to continue

PLEASE COMPILE AND RUN TO ENSURE CODE IS CORRECT BEFORE SENDING

Reference no: EM13936045

Questions Cloud

When the visual dss first starts up : In the first part of assessment, there are three questions which should be done by DSS Visual software according to the criteria. I am also going to attach the requirement criteria of the assignment,so please have a look very carefully because i a..
Main( ) function that instantiates one average object : Main( ) function that instantiates one Average object, and includes a for loop to take 10 inputs and calls to the calculation and output method.
Do you think that the prevailing one-year forward rate : Do you think that the prevailing one-year forward rate of Freeland's currency (the fre) would overestimate, underestimate, or be a reasonably accurate forecast of the spot rate one year from now?
What is the total purchase of tennis racquets : What is the total purchase of tennis racquets? Why? What is the consumer surplus? Why? What is the increase in consumer surplus when the market price drops to $ 50?
Explain reverse, sort and binary search : Because the C# array is an object member of the Array class it also comes with a number of built-in methods such as Reverse, Sort and Binary Search. You can use the Reverse method
Evaluate and analyse the leadership of a 21st century : Please read the brief and instructions thoroughly. Using relevant theories and models critically evaluate and analyse the leadership of a 21st century leader of a (business, government or not-for-profit) organisation.
Find total revenue and marginal revenue in both situation : The radio advertisement costs $600 a month (30 days), find the firm's profit per case of energy drink (hint: consider daily advertisement cost)
Online education proving to be successful : Is online education proving to be successful? Your task is to provide a critical review of the current market for online education as well as providing an overview and definition of what online education is and how it works.
Evaluate the organisational and national cultural issues : Identify and evaluate the organisational and national cultural issues that you may have to deal with on assuming responsibility for the new manufacturing facility.

Reviews

Write a Review

Programming Languages Questions & Answers

  Compare the points by y major order

Compare the Points by y major order, that is, points with similar y-coordinate values should come before those with higher y coordinate values. Break ties by comparing x-coordinate values.

  Travelling salesman problem

Travelling Salesman Problem on the L1-metric plane.

  Design application that would output payment coupons

Design the application that would output 12 payment coupons for each of the 15 apartments in each of the 20 buildings. Each coupon should contain the building number.

  Write statement to determine whether array elements are full

Write the statements needed to determine whether any of the the array elements are null or refer to the empty String. Set the variable hasEmpty to true if any elements are null or empty-- otherwise set it to false.

  Prepare class to include three data member

Prepare Class called Employee that includes three pieces of information as data members - first name (type string), last name (type string) and monthly salary (type float).

  Write a program that replies either leap or not a leap year

Write a program that replies either Leap Year or Not a Leap Year, given a year. It is a leap year if the year is divisible by 4 but not by 100 (for example, 1796 is a leap year because it is divisible by 4 but not by 100).

  Method to pass string argument and returns first line

Write a method, getFirstLine, that is passed a String argument and that returns the first line.

  Program for vehicle registration department

Consulting firm has narrowed the choice of programming language to Java and C#. Which language do you believe would be more suitable for this application and why?

  Write the program which simulates shopping

Write the program which simulates shopping. Program must have a loop which continues as long as user wants to shop. Each time through loop read in name, price, and quantity of the item.

  Make a note of how many records that were deleted

Save your SQL query as SQLQuery1D3 and execute the statement.

  Program to find sum-difference of two complex numbers

Program should ask user to enter two complex numbers and it automatically finds it sum, difference, coefficient, product conjugate.

  Explain how array simplifies program development

Describe the requirement for complex data structures and how they are utilized. Describe the design and application of arrays and how array simplifies program development.

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