Write a program that can be used by a ski resort to keep track of the local snow conditions for one week. It should have seven-element array of structures or class objects, where each structure or...

1 answer below »
Write a program that can be used by a ski resort to keep track of the local snow conditions for one week. It should have seven-element array of structures or class objects, where each structure or object holds a date and the number of inches of snow in the base on that date. The program should have the user input the name of the month, the starting and ending date of the seven-day period being measured, and then the seven base snow depths. The program should then sort the data in the ascending order by base depth and display the results (two functions one for sorting and one for displaying the results). Here is the beginning of a sample report. Snow Report December 12-18 Date Base 13 42.3 12 42.5 14 42.8


Microsoft Word - BCS230_Lab8_handout_93172.docx Lab08-BCS230,M.Alrajab 1 BCS230 Lab8HandoutandAssignment This lab handout provides two tasks that students are required to attempt during lab session. Lab objectives are for students to practice with: - Arrays and Arrays of Objects. - Classes and Objects. - Searching and Sorting. Task1: Charge account validation Modify the provided shell code to create a program that lets the user enter a charge account number. The program should determine if the number is valid by checking for it in the following list: 5658845, 4520125, 7895122, 8777541, 8451277, 1302850, 8080152, 4562555, 5552012, 5050552, 7825877, 1250255, 1005231, 6545231, 3852085, 7576651, 7881200, 4581002, Initialize a one-dimensional array with these values. Then use a simple linear search to locate the number entered by the user. If the user enters a number that is in the array, the program should display a message saying that number is valid. If the user enters a number no in the array, the program should display a message indicating it is invalid. Complete: ToDo 1: Read the input values. ToDo 2: Search for a specific value ToDo 3: Print if found #include usingnamespacestd; boolsearchList(long[],int,long);//Functionprototype constintSIZE=18; intmain() { longaccounts[SIZE]= {5658845,4520125,7895122,8777541, 8451277,1302850,8080152,4562555, 5552012,5050552,7825877,1250255, 1005231,6545231,3852085,7576651, 7881200,4581002,}; longacctNum; cout< "please="" enter="" a="" 7-digit="" account="" number:="" ";="" todo="" 1:="" read="" the="" input="" value="" todo="" 2:="" check="" if="" the="" account="" number="" is="" valid="" todo="" 3:="" print="" if="" found="" return="" 0;="" }="" bool="" searchlist(long="" list[],="" int="" numelems,="" long="" value)="" {="" bool="" found="false;" todo="" provide="" implementation="" of="" the="" linear="" search="" here="" return="" found;="" }="" lab08="" -="" bcs230,="" m.="" alrajab="" 2="" task2:="" modify="" the="" selectionsort="" function="" presented="" in="" ppt="" lecture="" notes="" so="" it="" sorts="" an="" array="" of="" strings="" instead="" of="" an="" array="" of="" ints.="" test="" the="" function="" as="" stated="" in="" the="" shell="" code="" below.="" complete:="" todo="" 1:="" using="" selectionsort="" complete="" the="" function="" implementation="" todo="" 2:="" convert="" the="" string="" to="" uppercase="" todo="" 3:="" print="" all="" elements="" in="" the="" array.=""> #include #include usingnamespacestd; //Functionprototype voidselectionSort(string[],int); stringupperCaseIt(conststring); voiddisplayNames(conststring[],int); intmain(){ constintSIZE=20; //Setupthearrayofstrings,inthiscasenames stringname[SIZE]= {"Collins,Bill","Smith,Bart","Michalski,Joe","Griffin,Jim", "Sanchez,Manny","Rubin,Sarah","Taylor,Tyrone","Johnson,Jill", "Allison,Jeff","Moreno,Juan","Wolfe,Bill","Whitman,Jean", "Moretti,Bella","Wu,Hong","Patel,Renee","Harrison,Rose", "Smith,Cathy","Conroy,Pat","Kelly,Sean","Holland,Beth"}; //Callafunctiontosortthestrings selectionSort(name,SIZE); //Callafunctiontodisplaythe(nowsorted)strings cout<"thenamesinsortedorderare:\n\n"; displaynames(name,size); return0; } voidselectionsort(stringname[],intnumstrings){ intstartscan,minindex; stringminvalue; //todo1:sortthestrings } stringuppercaseit(conststringstringin){ strings=stringin;//localcopyofstringinwe'lluppercase //todo2:convertthestringtouppercase returns; } voiddisplaynames(conststringname[],intnumnames){ //todo3:printallelements(numnames)ofthestringarray(name) } lab08-bcs230,m.alrajab 3 lab8–assignment. what to hand-in problem: write a program that can be used by a ski resort to keep track of the local snow conditions for one week. it should have seven-element array of structures or class objects, where each structure or object holds a date and the number of inches of snow in the base on that date. the program should have the user input the name of the month, the starting and ending date of the seven-day period being measured, and then the seven base snow depths. the program should then sort the data in the ascending order by base depth and display the results (two functions one for sorting and one for displaying the results). here is the beginning of a sample report. snow report december 12-18 date base 13 42.3 12 42.5 14 42.8 submissioninstructions • test your code before submission. • you should have either a class or a structure. • add comments to explain your solution. • due date is wed april/03/2018 @ 11:59pm • you are allowed to submit late with -5% per day. • submission will not be available after friday april/06/2018 @ 11:59pm. • if you have more than one submission the late will be graded. • check rubric. "the="" names="" in="" sorted="" order="" are:="" \n\n";="" displaynames(name,="" size);="" return="" 0;="" }="" void="" selectionsort(string="" name[],="" int="" numstrings="" ){="" int="" startscan,="" minindex;="" string="" minvalue;="" todo="" 1:="" sort="" the="" strings="" }="" string="" uppercaseit(const="" string="" stringin){="" string="" s="stringIn;" local="" copy="" of="" stringin="" we'll="" uppercase="" todo="" 2:="" convert="" the="" string="" to="" uppercase="" return="" s;="" }="" void="" displaynames(const="" string="" name[],="" int="" numnames){="" todo="" 3:="" print="" all="" elements="" (numnames)="" of="" the="" string="" array="" (name)="" }="" lab08="" -="" bcs230,="" m.="" alrajab="" 3="" lab8="" –="" assignment.="" what="" to="" hand-in="" problem:="" write="" a="" program="" that="" can="" be="" used="" by="" a="" ski="" resort="" to="" keep="" track="" of="" the="" local="" snow="" conditions="" for="" one="" week.="" it="" should="" have="" seven-element="" array="" of="" structures="" or="" class="" objects,="" where="" each="" structure="" or="" object="" holds="" a="" date="" and="" the="" number="" of="" inches="" of="" snow="" in="" the="" base="" on="" that="" date.="" the="" program="" should="" have="" the="" user="" input="" the="" name="" of="" the="" month,="" the="" starting="" and="" ending="" date="" of="" the="" seven-day="" period="" being="" measured,="" and="" then="" the="" seven="" base="" snow="" depths.="" the="" program="" should="" then="" sort="" the="" data="" in="" the="" ascending="" order="" by="" base="" depth="" and="" display="" the="" results="" (two="" functions="" one="" for="" sorting="" and="" one="" for="" displaying="" the="" results).="" here="" is="" the="" beginning="" of="" a="" sample="" report.="" snow="" report="" december="" 12-18="" date="" base="" 13="" 42.3="" 12="" 42.5="" 14="" 42.8="" submission="" instructions="" •="" test="" your="" code="" before="" submission.="" •="" you="" should="" have="" either="" a="" class="" or="" a="" structure.="" •="" add="" comments="" to="" explain="" your="" solution.="" •="" due="" date="" is="" wed="" april/03/2018="" @="" 11:59pm="" •="" you="" are="" allowed="" to="" submit="" late="" with="" -5%="" per="" day.="" •="" submission="" will="" not="" be="" available="" after="" friday="" april/06/2018="" @="" 11:59pm.="" •="" if="" you="" have="" more="" than="" one="" submission="" the="" late="" will="" be="" graded.="" •="" check="">
Answered Same DayMar 26, 2020BCS230

Answer To: Write a program that can be used by a ski resort to keep track of the local snow conditions for one...

Amit answered on Mar 28 2020
154 Votes
Student name:
Student ID number:
Course name:
Date:
Professor name:
Table of content
    Serial number
    Task na
me
    Page number
    1.
    Task 1
    3
    2.
    Task 2
    5
    3.
    Task 3
    8
Task 1
The desired modified program with respective output to show its execution is as given below:
#include
using    namespace    std;
bool searchList(long [], int, long);
const int SIZE =18;
int    main()
{
long accounts[SIZE]    ={5658845,    4520125, 7895122, 8777541,8451277,1302850,8080152,4562555,5552012,5050552,7825877,1250255,1005231,6545231,3852085,7576651,7881200,4581002};
long acctNum;
cout<<    "Please    enter a    7-digit    account    number:    ";
bool found=false;
cin>>acctNum;
found= searchList(accounts, SIZE , acctNum);
if(found)
cout<<"The number is valid\n";
else
cout<<"The number is not valid\n";
return    0;
}
bool searchList(long list[],int    numElems,long value)
{
bool found =false;
for(int loopCounter=0;loopCounter if(value==list[loopCounter])
found=true;
return    found;
}
Execution screen shot:
Task 2
The desired modified...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here