ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 24 May 2017 My Price 9.00

Start//Declarations//num MAXADS

I have provided the algorithm/ Pseudocode, which is in the attachment. Embed the algorithm in the source code file as comments.. Develop the logic for a C++ program that accepts classified advertising data, including a category code (an integer 1 through 15) and the number of words in the ad. Store these values in parallel arrays. Then sort the array so that records are sorted in ascending order by category. The output lists each category number, the number of ads in the category, and the total number of words in the ads in the category. Compile and run the C++ program with no errors! 

 

//// Start//Declarations//num MAXADS = 100//num adcatcode[MAXADS]//num adwords[MAXADS]//num curCode//num numads//num i//num j//num k//num subtotal//num temp//output "Please enter the number of ads: "//input numads//if ((numads > 0) and (numads <= MAXADS))//for i = 0 to numads - 1//output "Please enter Advertisement Category Code (1 - 15): "//input adcatcode[i]//output "Please enter number of words for the advertisement: "//input adwords[i]//endfor//for i = 0 to numads - 2//for j = 0 to numads - 2//if (adcatcode[j] > adcatcode[j+1])//temp = adcatcode[j]//adcatcode[j] = adcatcode[j+1]//adcatcode[j+1] = temp//temp = adwords[j]//adwords[j] = adwords[j+1]//adwords[j+1] = temp//endif//endfor//endfor//output "Total Word Counts Sorted By Category Code"//output "========================================="//k = 0//while k <= numads - 1//subtotal = 0//curCode = adcatcode[k]//while ( (curCode = adcatcode[k]) and (k <= numads - 1) )//subtotal = subtotal + adwords[k]//k = k + 1//endwhile//output "Category: ",adcatcode[k - 1], "","Word Count: ",subtotal//endwhile//else//output "Number adds requested less than 1 or is too large; ad limitis ",MAXADS//endif// Stop

Attachments:

Answers

(11)
Status NEW Posted 24 May 2017 08:05 AM My Price 9.00

-----------

Attachments

file 1495614287-Solutions file 2.docx preview (51 words )
H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly -----------onl-----------ine----------- an-----------d g-----------ive----------- yo-----------u e-----------xac-----------t f-----------ile----------- an-----------d t-----------he -----------sam-----------e f-----------ile----------- is----------- al-----------so -----------sen-----------t t-----------o y-----------our----------- em-----------ail----------- th-----------at -----------is -----------reg-----------ist-----------ere-----------d o-----------n -----------THI-----------S W-----------EBS-----------ITE-----------. ----------- Th-----------ank----------- yo-----------u -----------
Not Rated(0)