What happens if you use larger numbers to declare thearrays

Assignment Help C/C++ Programming
Reference no: EM131236069

Lab 4

Learning Exercises for you to try:

1. Change the code to average 20 integers as opposed to 10. Support your experimentation with screen captures of executing the new code. What happens if you change the formatter to %.2f printf("average is %.2f\n " ,avg );

2. What happens if you entered a value other than an integer? (For example a float or even a string). Support your experimentation with screen captures of executing the code. To help in your analysis try as input 1 2 3 a 4 5 Hint: activate this line if(debug) printf(" value is %d\n " , value ); after the scanf statement that reads in the value. Activate by changing the value of debug. Next try as input 1.1 2.2 3.3 4.4 5.5 6.6 7.7 8.8 9.9 10.5 What happens?

3. Modify the code to allow the user to enter an unspecified number of positive integers and calculate the average. In other words, the user could enter any number of positive integers. (Hint: You can prompt the user for how many they want to enter. Or; you could use a sentinel value to trigger when the user has completed entering values). You may need to conduct some research on your own to solve this problem.

4. Prepare a new test table with at least 3 distinct test cases listing input and expected output for the code you created. Support your experimentation with screen captures of executing the new code.

Lab 5

Learning Exercises for you to try:

1. Modify the output printf statement so that the average grade is displayed with just three decimals places and so that there is two tabs between the student name and his average grade. Support your experimentation with screen captures of executing the new code.

2. Describes what happens when you moved the Set Sum = 0.0 from inside the for loop to right after the declaration.

For example:

// Declare variables

Declare StudentName as String

Declare ExamValue, Sum, Avg as Float

// Initialize Sum

Set Sum = 0.0;

Support your experimentation with screen captures of executing the new code.

3. Move the Set Sum = 0.0 back to where it was before (inside the loop). Modify the code to be able to input an undetermined number of students. You will still only have 3 exams for each student. Support your experimentation with screen captures of executing the new code. Submit this code in a separate .txt ( or .c ) file.

4. Prepare a new test table with at least 3 distinct test cases listing input and expected output for the code you created after step 4.

Lab 7

Learning Exercises for you to try:

1. Modify the program to sum the rainfall for eachyear.

(Hint: this is NOT part of the input. You have all the data collected, you need to sum for each year from the data you collected during the input.) You can do this using a looping structure during the output function printdata.) Support your experimentation with screen captures of executing the new code

2. Enhance the program to allow the user to enter another meteorological element such as windspeed (e.g. 2.4 mph). (Hint: you will need another array). Note, the user should be able to enter both rainfall and windspeed in your new implementation.-You will need to update the input data and printd at a functions. Support your experimentation with screen captures of executing the new code. Submit your code as a separate .txt (or .c )file.

3. Prepare a new test table with at least 2 distinct test cases listing inputand expected output for the code you created after step2

4. What happens if you change the NUMMONTHS and NUMYEARS de finitions to other values? Be sure to use both lower and higher values. Describe what happens if you use larger numbers to Declare thearrays. Describe what happens if you use lower numbers to Declare thearrays.

Support your experimentation with screen captures of executing the new code.

Attachment:- Labs.rar

Reference no: EM131236069

Questions Cloud

Estimate the 3 month eurodollar futures price quote : Suppose that the 9-month LIBOR interest rate is 8% per annum and the 6-month LIBOR interest rate is 7.5% per annum. Estimate the 3-month Eurodollar futures price quote for a contract maturing in 6 months.
Write annotation of each article : Write a 100 word annotation of each article in which you not only summarize each article but also evaluate its theme (the main point the article tries to make)
What is likely to be the impact on the hedge : Suppose that a bond portfolio with a duration of 12 years is hedged using a futures contract in which the underlying asset has a duration of 4 years. What is likely to be the impact on the hedge of the fact that the 12-year rate is less volatile t..
Nissan motor corporation advertisement : A Nissan Motor Corporation advertisement read, "The average man's I.Q. is 107. The average brown trout's I.Q. is 4. So why can't man catch brown trout?" Suppose you believe that the brown trout's mean I.Q.
What happens if you use larger numbers to declare thearrays : What happens if you change the NUMMONTHS and NUMYEARS de finitions to other values? Be sure to use both lower and higher values. Describe what happens if you use larger numbers to Declare thearrays.
Draw a lai artifact table to define a module : Using the notation of your choice, draw a process diagram of a software development process that prototypes three different designs and choose the best from among them.
Conduct a hypothesis test of your belief : You catch 12 brown trout. A fish psychologist determines the I.Q.s as follows: 5; 4; 7; 3; 6; 4; 5; 3; 6; 3; 8; 5. Conduct a hypothesis test of your belief.
Discuss the important features of data mining tools : MAN6905 - Databases and Business Intelligence - Choose TWO large datasets and analyse them with pivot tables. Document the insights and trends that you find during the analysis.
How should the portfolio manager immunize the portfolio : The December Treasury bond futures price is currently 91-12 and the cheapest-to-deliver bond will have a duration of 8.8 years at maturity. How should the portfolio manager immunize the portfolio against changes in interest rates over the next 2 m..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create functions based on your existing source code

Create functions based on your existing source code (ex. GetCar, CreateCar, CalculateLapTime) which take in the appropriate parameters and give the correct output. Use pointers where applicable.

  Declare and initialize an appropriate variable

Show the source code for a C# console application names ‘Sibs' that prints your frist name on the first line, your last name on the second line, and the number of siblings you have on the third line Declare and initialize an appropriate variable fo..

  Write c function to sort one dimensional integer array

Consider the values sorted in the array. Sort it in ascending order using Bubble sort technique showing all iterations: write C function to sort one dimensional integer array in ascending order.

  Investigate the standards development process

Investigate the Standards Development process for IT type products and interfaces. Identify at least two ways that standards are agreed to. Identify two instances where the standard was set based on a market leading technology.

  Write a c program that calculate the gross pay of employee

Write a C program that will calculate the gross pay of a set of employees. For each employee the program should prompt the user to enter the clock number, wage rate, and number of hours as shown below.

  What are the values of *ptr and **ptrptr

Using no other objects besides those already declared, how can you alter ptrPtr so that is points to a pointer to b withoutdirectly touching ptr?

  Contacts class that contains an array

Create a Friend class that contains a first name, last name, a birthday, and a telephone number. Create a Contacts class that contains an array of Friend as well as the owner's name and cell phone Number.

  Write a value-returning function

Write a program that uses the function isNumPalindrome given(Palindrome Number). Test your program on the following numbers: 10, 34, 22, 333, 678, 67876, 44444, and 123454321.

  Calculate the cost of items before discount

Build a program that calculates a discount for items based on quantity bought - Calculate the cost of items before discount.

  How the project teams and coaches master agile methodology

Analyze how the project teams and coaches master the agile methodology to solve business problems. Highlight the one that you believe is the most effective and support your answer.

  Construct the wait-for graph

P2 waits for 2 units of R1 and holds 1 unit of R2, P3 holds 2 units of R3 and waits for 1 unit of R4, P4 holds 2 units of R3 and waits for 1 unit of R4. Construct the wait-for graph. Does the system have a deadlock? Justify your answer

  Perform the five arithmetic operations

A program that declares and prompts the user to enter two integer and performs the five arithmetic operations

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd