Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

At Unknown University, the Admissions department has discovered that the best applicants usually go to big-name schools instead and the worst often do poorly in courses, so the school wants to concentrate recruitment efforts and financial aid resources on the middle half of the
applicants. You must prepare a program that takes a file containing a list of applicants, in which each applicant has a name and a total SAT score, and prints an alphabetical list of the middle half of these applicants. (Eliminate the best quarter and the worst quarter, then alphabetize the rest). This can be done using a simple iterative technique. First, read the data from a file named apply.txt into an array of structures (let N be the total number of applicants). This begin a loop that eliminates applicants one at a time, until only half are left. Within this loop, let first be a pointer to the first array element that is still included, last be a pointer to the last one,and r (the number of remaining) be initialized to N. Each time around the loop, either first is incremented or last is decremented and r decreases by 1. At each step, 

a) If r is even, find the remaining applicant with the lowest SAT score and swap it with the applicant at first. Then increment first, decrement r,and repeat.
b) If r is odd, find the remaining applicant with the highest SAT score and swap it with the applicant at last. Then decrement last and r and repeat.
c) Quit when r <= N/2. Return the values of first and r.
When only half the applicants are left, use any sort technique to sort them alphabetically. prepare the sorted list to a user-specified output file. 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M988860

Have any Question?


Related Questions in Computer Engineering

Question suppose host a has 10 packets with sequence

Question : Suppose host A has 10 packets with sequence numbers 1 to 10 to be transmitted to host B. Now imagine that the packets numbered 2 and 7 are lost when they were sent the first time. Assume that ACKs are never lo ...

Suppose a consumer is trying to make a choice over the

Suppose a consumer is trying to make a choice over the consumption of two goods: x and y. Px = 3, Py = 4 and the income is equal to 50. Assume that the government distributes some stamps that are good to buy 5 units of g ...

Suppose i am designing a personnel database for a

Suppose I am designing a personnel database for a university. The university has three types of personnel: students, staff, and faculty. Here are the characteristics of the three groups: -All three groups have a name and ...

Suppose you are doing some online banking using your banks

Suppose you are doing some online banking using your bank's website. An attacker has set up an active wiretap between your computer and your bank's server. After checking your balance and reading through your transaction ...

A chemistry student needsnbsp600 mlnbspof carbon

A chemistry student needs 60.0 mL of carbon tetrachloride for an experiment. By consulting the  CRC Handbook of Chemistry and Physics , the student discovers that the density of carbon tetrachloride is 1.59 g.cm^-3. Calc ...

A chemist weighed outnbsp779 g of calcium calculate the

A chemist weighed out 77.9 g of calcium. Calculate the number of moles of calcium she weighed out. Round your answer to 3 significant digits.

What are some examples of when a data compression utility

What are some examples of when a data compression utility can be used for information stored on a computer's hard drive?

Do the next application and answer the questions1 print a

Do the next application and answer the questions: 1 /** Print a friendly greeting. */ 2 public static void main(String[] args) { 3 int index; 4 for(index = 0; index 6} 7} Questions: 1. What is the scope of index in the a ...

Enter probability as a fraction or as a decimal rounded to

Enter probability as a fraction or as a decimal rounded to nearest thousandth (three A basket contains six red and four blue marbles. Three marbles are drawn at random without replacement. (WITHOUT using combinations) de ...

Systems analysis projectpersonal trainer inc owns and

Systems analysis project Personal Trainer, Inc. owns and operates fitness centers in a dozen Midwestern cities. The centers have done well, and the company is planning an international expansion by opening a new "superce ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As