100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

CMIS 102 Hands-On Lab Week 8 Overview: This hands-on lab allows you to follow and experiment with the critical steps of developing a program including the program description, Analysis, Design(program design, pseudocode), Test Plan, and implementation wit

Rating
-
Sold
-
Pages
12
Grade
A+
Uploaded on
21-03-2023
Written in
2022/2023

CMIS 102 Hands-On Lab Week 8 Overview: This hands-on lab allows you to follow and experiment with the critical steps of developing a program including the program description, Analysis, Design(program design, pseudocode), Test Plan, and implementation with C code. The example provided uses sequential, repetition, selection statements, functions, strings, and arrays. Program Description: This program will input and store meteorological data into an array. The program will prompt the user to enter the average monthly rainfall for a specific region and then use a loop to cycle through the array and print out each value. The program should store up 5 years of meteorological data. Analysis: I will use sequential, selection, and repetition programming statements and an array to store data. I will define a 2-D array of Float number: Raindata[][] to store the Float values input by the user. To store up to 5 years of monthly data, the array size should be at least 5*12 = 60 elements. A float number (rain) will also be needed to input the individual rain data. An integer variable (Count) is needed to keep count of how many rain data elements were entered. This will keep track to make sure we don’t go over 60 and we print only valid rain elements. In a 2D array this will be RainData[5][12]. We can use #defines to set the number of years and months to eliminate hard coding values. A float number (rain) will also be needed to input the individual rain data. A nested for loop can be used to iterate through the array to enter Raindata. A nested for loop can also be used to print the data in the array. A array of strings can be used to store year and month names. This will allow a tabular display with labels for the printout. Functions will be used to separate functionality into smaller work units. Functions for displaying the data and inputting the data will be used. A selection statement will be used to determine if data should be entered. Program Design: Main // This program will prompt the user to input and store meteorological data into an array for each month for five years. It will then display the collected data. // Declare variables // Initialize variables //Prompt user if he wants to input participation data // IF yes // Call function to Input Data // Call function to Print Data // Else // Endif End //End of Main 2 Function InputData // Loop for number of years //Loop for number of months //Prompt user for rain amount //Get user response //Assign data to array //End loop - months //End loop – years End Function Function PrintData // Loop for number of years //Loop for number of months //Print out all data form arrays //End loop - months //End loop – years End Function Test Plan: To verify this program is working properly the input values could be used for testing: Test Case Input Expected Output 1 Enter data? = y

Show more Read less
Institution
Module









Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
Study
Module

Document information

Uploaded on
March 21, 2023
Number of pages
12
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

CMIS 102 Hands-On Lab Week 8 | Complete Solution latest update 2023


CMIS 102 Hands-On Lab

Week 8 - Concerts

Overview
This hands-on lab allows you to follow and experiment with the critical steps of developing a program
including the program description, analysis, test plan, and implementation with C code. The example
provided uses sequential, repetition, selection statements, functions, strings and arrays.

Program Description

Compute the value of the ticket sales for concerts and the total sales for a series of concerts. Then
display the concert information in a sorted list.

Technologies used in this project:

 strings stored as char arrays
 2 dimensional char and int arrays
 getting data from the user into the various arrays
 using only part of an array for valid data
 computing array arithmetic – vector inner products to compute a value
 sorting using selection sort
 displaying data in arrays

Interaction

Outline:

1. Get the ticket price for each 3 categories.
a. float float float
2. Get the band name and numbers of fans for each category of each concert.
a. String int int int
b. NOTE: spaces are not allowed in the band names, so use underscores instead of spaces.
c. Period will end the input.
3. Internal computations:
a. Compute the value of the sales for each concert.
b. Compute the total value of the ticket sales.
c. Sort the concerts by value of the ticket sales.
4. Display the resulting data in a nice format.

Notes:

1. This program is not expected to behave nicely if the input does not follow the specifications
above.
2. All numbers this program will handle should be of moderate size. The exact meaning of
moderate is made precise by the data types, print statements, and array sizes.




Page 1 of 12

, CMIS 102 Hands-On Lab Week 8 | Complete Solution latest update 2023




Analysis

1. Since we are going to do sorting, we will need to hold the data in arrays.
2. We will use functions to simplify the code, and reflect a modular approach to the design of the
project.
3. We will use global variables to reduce the amount information transferred in parameter lists.
4. We will use a fixed number of categories, but let the number of concerts by determined by the
user at run time, up to a maximum value.
5. The user will end inputting the group information with a flag value, a period.
6. Basic data types
a. ticket prices – float
b. name of concert/band – char array
c. number of concerts and number of fans in each category at each concert – int
d. number of concerts – int.
e. value of tickets – float
7. We will use nested loops to handle most operations:
a. reading the ticket prices
b. reading the group name and attendance
c. computing the value of the ticket sales
d. printing the array of data
e. sorting the arrays by the value of the ticket sales




Page 2 of 12

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Highland Chamberlain College Nursing
Follow You need to be logged in order to follow users or courses
Sold
11
Member since
3 year
Number of followers
11
Documents
576
Last sold
1 year ago

2.5

2 reviews

5
0
4
1
3
0
2
0
1
1

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions