Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Tentamen (uitwerkingen)

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

Beoordeling
-
Verkocht
-
Pagina's
12
Cijfer
A+
Geüpload op
21-03-2023
Geschreven 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

Meer zien Lees minder
Instelling
Vak

Voorbeeld van de inhoud

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

Geschreven voor

Instelling
Studie
Vak

Documentinformatie

Geüpload op
21 maart 2023
Aantal pagina's
12
Geschreven in
2022/2023
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

€14,85
Krijg toegang tot het volledige document:

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kan je een ander document kiezen. Je kan het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
LAWEXEPRT Universiteit van Amsterdam
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
30
Lid sinds
3 jaar
Aantal volgers
16
Documenten
946
Laatst verkocht
1 maand geleden
LI prepare and sell top quality notes that are concise and easy to understand to LPC, LLM and LLB students. The LLB and LPC are difficult courses, not to mention the thousands of pages you need to read during your prep. I know how overwhelming it all can

I have done papers of various topics and complexities. I am punctual and always submit work on-deadline. I write engaging and informative content on all subjects. Send me your research papers, case studies, psychology papers, etc, and I’ll do them to the best of my abilities. Writing is my passion when it comes to academic work. I’ve got a good sense of structure and enjoy finding interesting ways to deliver information in any given paper. I love impressing clients with my work, and I am very punctual about deadlines. Send me your assignment and I’ll take it to the next level. I strive for my content to be of the highest quality. Your wishes come first— send me your requirements and I’ll make a piece of work with fresh ideas, consistent structure, and following the academic formatting rules.

Lees meer Lees minder
4,5

4 beoordelingen

5
2
4
2
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via Bancontact, iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo eenvoudig kan het zijn.”

Alisha Student

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen