SlideShare a Scribd company logo
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 statements and nested
repetition statements.
Program Description:
This program will calculate the average of 10 positive integers.
The program will ask the user to 10 integers. If any of the
values entered is negative, a message will be displayed asking
the user to enter a value greater than 0. The program will use a
loop to input the data.
Analysis:
I will use sequential, selection and repetition programming
statements.
The program will loop for 10 positive numbers, prompting the
user to enter a number.
I will define three integer variables: count, value and sum.
count will store how many times values greater than 0 are
entered. value will store the input. Sum will store the sum of all
10 integers.
I will define one double number: avg. avg will store the average
of the ten positive integers input.
The sum will be calculated by this formula: sum = sum + value
For example, if the first value entered was 4 and second was 10:
sum = sum + value = 0 + 4
sum = 4 + 10 = 14
Values and sum can be input and calculated within a repetition
loop: while count <10
Input value
sum = sum + value End while
Avg can be calculated by: avg = value/count
A selection statement can be used inside the loop to make sure
the input value is positive.
If value >= 0 then count = count + 1 sum = sum + value
Else
input value End If
(
7
)
Program Design:
Main
// This program will calculate the average of 10 integer numbers
// Declare variables
// Initialize variables
// Loop through 10 numbers
// Prompt for positive integer
// Get input
// test input value for gt 0 if (value > 0)
//Increment counter
//Accumulate sum Else
// display msg to enter a positive integer
// Prompt for positive integer
// Get input Endif
// End loop
//Calculate average
//Print the results (average)
End
Test Plan:
To verify this program is working properly the input values
could be used for testing:
Test Case
Input
Expected Output
1
1 1 1 0 1
2 0 1 3 2
Average = 1.2
2
100 100 100 100 -100
Input a positive value
100 200 -200 200 200
Input a positive value
200 200
average is 120.0
NOTE: test #2 has 12 input numbers because there are two
negative numbers.
Pseudocode: Main
// This program will calculate the average of 10 positive
integers.
// Declare variables
Declare count, value, sum as Integer Declare avg as double
//Initialize values
Set count=0 Set sum = 0 Set avg = 0.0;
// Loop through 10 integers While count < 10
Input value
If (value >=0)
sum = sum + value count=count+1
Else
Pr *** Value must be positive *** Input value
End if End While
// Calculate average avg = sum/count
// Print results
End //End of Main
C Code
The following is the C Code that will compile in execute in the
online compilers.
#include <stdio.h>
#include <stdbool.h> // needed for the Boolean variable
debug.
int main ()
{
/* variable definition: */ int count, value, sum; float avg;
bool debug;
/* Initialize */ count = 0;
sum = 0;
avg = 0.0; debug = false;
// Loop through to input values while (count < 10)
{
printf("Enter a positive Integern"); scanf("%d", &value);
if (debug) printf(" value is %dn " , value ); //note the value
of debug if (value >= 0) {
sum = sum + value; count = count + 1;
}
else {
printf("Value must be positiven");
}
}
// Calculate avg.
// Since sum and count are both integers, this will give you an
integer division
// Hence, we need to either
// Declare sum as a float or...
// type cast sum as float (as shown below) avg = (float)
sum/count;
printf("sum is %dn", sum); printf("average is %fn " , avg );
return 0;
}
Setting up the code and the input parameters in ideone.com:
Note the input integer values are 1, 1, 1, 0, 1, 2, 0, 1, 3, 2 for
this test case.
You can change these values to any valid integer values to
match your test cases.
You should also test with a negative number to make sure the
positive integer logic works properly.
Note: the input data needs to be entered into the stdin window
separated by a space of new line.
Results from running the programming at ideone.com:
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 %.2fn " , 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 %dn " , 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.
Loop (Repetition) with Nested selection n
statement
v Hide Description
(
10/3/2016
) (
Loop
(Repetition)
with
Nested
selection
statement
-
CMIS
102
6386
Introduction
to
Problem
Solving
and
Algorithm
Design
(2168)
)
Whne {Cost > 0) If (Cost > 150)
If (Staff > 12)
Fee = 110
Else
Fee = 115
Endlf
NESTED LOOPS, Ifs
Else
Fee = 12.0,
nplf
EndWhi le
Part 1:
Create a While-End repetition structure that includes a nested
if-then selection structure. Provide an overview (i.e. Program
Design) of what your repetition structure is doing as well as the
Pseudocode.
Create a program that handles 150 passengers of an Airline with
the following requirements: The first 25 passenger the ticket
price is $90. The remaining passengers the ticket price is $100.
The first 100 passengers get a ticket. The next 25 (i.e 101-
125) are put on standby. No more passengers are accepted after
125. Print out a message for each of the above categories .
Part 2:
Convert Discussion 1 to C-code. Don't for get to indent your
code. Put Discussion 2 - problem no.X in the Subject area and
submit a .txt (or .c) file for your code.
1/2
CurrDate (i.e. 2016mmdd)
StartDate (i.e. 2016mmdd) // Mon start of week EndDate (i.e.
2016mmdd) // Sun end of week maxRecs 37 II the number of
data records
Here is what you have to work with. Don't worry about writing
the data, just setting the background color. Hint: you need to
compare the Date variables : CurrDate , StartDate, EndDate.
What is special about the Yellow background ? To set the Beige
background you need to work with prevYear and Year - Year
you determine from CurrDate, prevYear you need to set in your
loop appropriately.
Declare CurrDate, StartDate, EndDate, Year, prevYear,
maxRecs, recCount AS Integer Declare bckColor AS String
Set recCount = 0 Set prevYear = 0
Set bckColor = "Yellow" Set bckColor = "Pink"
Set bckColor = "LgtGreen" Set bckColor = 'DrkGreen" Set
bckColor = "Beige"
Set recCount = recCount + 1
https://learn.um
uc.edu/d21/le/content/170212/viewContent/7503189 Niew
212
Create an Parallel Arrays
PreviousNext
Hide Description
Parallel Arrays
In Pseudocode, declare two 1-dimensional parallel arrays to
store the information requested in the problems below.
Use a one loop to prompt the user for the information and
assign it to the parallel arrays.
Then use a second loop to display the values of the parallel
arrays.
Put Part 1 - problem no. (1,2,3,4,5,6,7,8) in the Subject area.
Collect the following information, State and Population
You may do additional problems, if you want.
Part 2:
Convert Discussion 1 to C-code. Don't for get to prototype your
function before the main and to define your function after the
main. Put Discussion 2 - problem no.X in the Subject area and
submit a .txt (or .c) file for your code.

More Related Content

Similar to OverviewThis hands-on lab allows you to follow and experiment w.docx (20)

DOC
Programming egs
Dr.Subha Krishna
 
DOCX
Pseudo code practice problems+ c basics
akshay kumar
 
PDF
Lecture10(Repetition-Part 1) computers.pdf
jayyusimagdaong24
 
PDF
C and Data structure lab manual ECE (2).pdf
janakim15
 
PDF
25422733 c-programming-and-data-structures-lab-manual
kamesh dagia
 
PPT
C tutorial
Anurag Sukhija
 
DOCX
CMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docx
clarebernice
 
DOCX
Hargun
Mukund Trivedi
 
PDF
Common problems solving using c
ArghodeepPaul
 
PPTX
C Programming Homework Help
Programming Homework Help
 
PDF
PPS SSSSHHEHESHSHEHHEHAKAKHEHE12131415.pdf
YashShekhar6
 
DOCX
Workshop03.docx lap trinh C cho người mới bắt đầu
linhtran111111111111
 
PDF
Computer experiments 1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branch
SAKSHIGAWADE2
 
DOCX
C lab
rajni kaushal
 
DOCX
C lab manaual
manoj11manu
 
PPTX
Embedded systems
Mitul Tank
 
DOCX
Let us C (by yashvant Kanetkar) chapter 3 Solution
Hazrat Bilal
 
PDF
Chapter 13.1.5
patcha535
 
PDF
C lab programs
Dr. Prashant Vats
 
PDF
C lab programs
Dr. Prashant Vats
 
Programming egs
Dr.Subha Krishna
 
Pseudo code practice problems+ c basics
akshay kumar
 
Lecture10(Repetition-Part 1) computers.pdf
jayyusimagdaong24
 
C and Data structure lab manual ECE (2).pdf
janakim15
 
25422733 c-programming-and-data-structures-lab-manual
kamesh dagia
 
C tutorial
Anurag Sukhija
 
CMIS 102 Hands-On LabWeek 6OverviewThis hands-on lab .docx
clarebernice
 
Common problems solving using c
ArghodeepPaul
 
C Programming Homework Help
Programming Homework Help
 
PPS SSSSHHEHESHSHEHHEHAKAKHEHE12131415.pdf
YashShekhar6
 
Workshop03.docx lap trinh C cho người mới bắt đầu
linhtran111111111111
 
Computer experiments 1^j2^j3^j4^j8^j9. d24 ^j sakshi gawade cs branch
SAKSHIGAWADE2
 
C lab manaual
manoj11manu
 
Embedded systems
Mitul Tank
 
Let us C (by yashvant Kanetkar) chapter 3 Solution
Hazrat Bilal
 
Chapter 13.1.5
patcha535
 
C lab programs
Dr. Prashant Vats
 
C lab programs
Dr. Prashant Vats
 

More from gerardkortney (20)

DOCX
· Describe strategies to build rapport with inmates and offenders .docx
gerardkortney
 
DOCX
· Debates continue regarding what constitutes an appropriate rol.docx
gerardkortney
 
DOCX
· Critical thinking paper ·  ·  · 1. A case study..docx
gerardkortney
 
DOCX
· Create a Press Release for your event - refer to slide 24 in thi.docx
gerardkortney
 
DOCX
· Coronel & Morris Chapter 7, Problems 1, 2 and 3.docx
gerardkortney
 
DOCX
· Complete the following problems from your textbook· Pages 378.docx
gerardkortney
 
DOCX
· Consider how different countries approach aging. As you consid.docx
gerardkortney
 
DOCX
· Clarifying some things on the Revolution I am going to say som.docx
gerardkortney
 
DOCX
· Chapter 9 – Review the section on Establishing a Security Cultur.docx
gerardkortney
 
DOCX
· Chapter 10 The Early Elementary Grades 1-3The primary grades.docx
gerardkortney
 
DOCX
· Chapter 5, Formulating the Research Design”· Section 5.2, Ch.docx
gerardkortney
 
DOCX
· Chap 2 and 3· what barriers are there in terms of the inter.docx
gerardkortney
 
DOCX
· Case Study 2 Improving E-Mail Marketing ResponseDue Week 8 an.docx
gerardkortney
 
DOCX
· Briefly describe the technologies that are leading businesses in.docx
gerardkortney
 
DOCX
· Assignment List· My Personality Theory Paper (Week Four)My.docx
gerardkortney
 
DOCX
· Assignment List· Week 7 - Philosophical EssayWeek 7 - Philos.docx
gerardkortney
 
DOCX
· Assignment 3 Creating a Compelling VisionLeaders today must be .docx
gerardkortney
 
DOCX
· Assignment 4· Week 4 – Assignment Explain Theoretical Perspec.docx
gerardkortney
 
DOCX
· Assignment 2 Leader ProfileMany argue that the single largest v.docx
gerardkortney
 
DOCX
· Assignment 1 Diversity Issues in Treating AddictionThe comple.docx
gerardkortney
 
· Describe strategies to build rapport with inmates and offenders .docx
gerardkortney
 
· Debates continue regarding what constitutes an appropriate rol.docx
gerardkortney
 
· Critical thinking paper ·  ·  · 1. A case study..docx
gerardkortney
 
· Create a Press Release for your event - refer to slide 24 in thi.docx
gerardkortney
 
· Coronel & Morris Chapter 7, Problems 1, 2 and 3.docx
gerardkortney
 
· Complete the following problems from your textbook· Pages 378.docx
gerardkortney
 
· Consider how different countries approach aging. As you consid.docx
gerardkortney
 
· Clarifying some things on the Revolution I am going to say som.docx
gerardkortney
 
· Chapter 9 – Review the section on Establishing a Security Cultur.docx
gerardkortney
 
· Chapter 10 The Early Elementary Grades 1-3The primary grades.docx
gerardkortney
 
· Chapter 5, Formulating the Research Design”· Section 5.2, Ch.docx
gerardkortney
 
· Chap 2 and 3· what barriers are there in terms of the inter.docx
gerardkortney
 
· Case Study 2 Improving E-Mail Marketing ResponseDue Week 8 an.docx
gerardkortney
 
· Briefly describe the technologies that are leading businesses in.docx
gerardkortney
 
· Assignment List· My Personality Theory Paper (Week Four)My.docx
gerardkortney
 
· Assignment List· Week 7 - Philosophical EssayWeek 7 - Philos.docx
gerardkortney
 
· Assignment 3 Creating a Compelling VisionLeaders today must be .docx
gerardkortney
 
· Assignment 4· Week 4 – Assignment Explain Theoretical Perspec.docx
gerardkortney
 
· Assignment 2 Leader ProfileMany argue that the single largest v.docx
gerardkortney
 
· Assignment 1 Diversity Issues in Treating AddictionThe comple.docx
gerardkortney
 
Ad

Recently uploaded (20)

PPTX
How to Create Rental Orders in Odoo 18 Rental
Celine George
 
PDF
1, 2, 3… E MAIS UM CICLO CHEGA AO FIM!.pdf
Colégio Santa Teresinha
 
PPTX
SCHOOL-BASED SEXUAL HARASSMENT PREVENTION AND RESPONSE WORKSHOP
komlalokoe
 
PDF
IMP NAAC-Reforms-Stakeholder-Consultation-Presentation-on-Draft-Metrics-Unive...
BHARTIWADEKAR
 
PPTX
How to Manage Promotions in Odoo 18 Sales
Celine George
 
PPTX
Accounting Skills Paper-I, Preparation of Vouchers
Dr. Sushil Bansode
 
PPTX
Explorando Recursos do Summer '25: Dicas Essenciais - 02
Mauricio Alexandre Silva
 
PPTX
How to Configure Storno Accounting in Odoo 18 Accounting
Celine George
 
PDF
Federal dollars withheld by district, charter, grant recipient
Mebane Rash
 
PPTX
How to Configure Lost Reasons in Odoo 18 CRM
Celine George
 
PPSX
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
PPTX
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
PDF
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
PDF
The-Beginnings-of-Indian-Civilisation.pdf/6th class new ncert social/by k san...
Sandeep Swamy
 
PPTX
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
PDF
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
PPTX
ROLE OF ANTIOXIDANT IN EYE HEALTH MANAGEMENT.pptx
Subham Panja
 
PPTX
Pyhton with Mysql to perform CRUD operations.pptx
Ramakrishna Reddy Bijjam
 
PPTX
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
PPTX
Presentation: Climate Citizenship Digital Education
Karl Donert
 
How to Create Rental Orders in Odoo 18 Rental
Celine George
 
1, 2, 3… E MAIS UM CICLO CHEGA AO FIM!.pdf
Colégio Santa Teresinha
 
SCHOOL-BASED SEXUAL HARASSMENT PREVENTION AND RESPONSE WORKSHOP
komlalokoe
 
IMP NAAC-Reforms-Stakeholder-Consultation-Presentation-on-Draft-Metrics-Unive...
BHARTIWADEKAR
 
How to Manage Promotions in Odoo 18 Sales
Celine George
 
Accounting Skills Paper-I, Preparation of Vouchers
Dr. Sushil Bansode
 
Explorando Recursos do Summer '25: Dicas Essenciais - 02
Mauricio Alexandre Silva
 
How to Configure Storno Accounting in Odoo 18 Accounting
Celine George
 
Federal dollars withheld by district, charter, grant recipient
Mebane Rash
 
How to Configure Lost Reasons in Odoo 18 CRM
Celine George
 
Health Planning in india - Unit 03 - CHN 2 - GNM 3RD YEAR.ppsx
Priyanshu Anand
 
Growth and development and milestones, factors
BHUVANESHWARI BADIGER
 
CEREBRAL PALSY: NURSING MANAGEMENT .pdf
PRADEEP ABOTHU
 
The-Beginnings-of-Indian-Civilisation.pdf/6th class new ncert social/by k san...
Sandeep Swamy
 
HYDROCEPHALUS: NURSING MANAGEMENT .pptx
PRADEEP ABOTHU
 
ARAL_Orientation_Day-2-Sessions_ARAL-Readung ARAL-Mathematics ARAL-Sciencev2.pdf
JoelVilloso1
 
ROLE OF ANTIOXIDANT IN EYE HEALTH MANAGEMENT.pptx
Subham Panja
 
Pyhton with Mysql to perform CRUD operations.pptx
Ramakrishna Reddy Bijjam
 
Views on Education of Indian Thinkers Mahatma Gandhi.pptx
ShrutiMahanta1
 
Presentation: Climate Citizenship Digital Education
Karl Donert
 
Ad

OverviewThis hands-on lab allows you to follow and experiment w.docx

  • 1. 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 statements and nested repetition statements. Program Description: This program will calculate the average of 10 positive integers. The program will ask the user to 10 integers. If any of the values entered is negative, a message will be displayed asking the user to enter a value greater than 0. The program will use a loop to input the data. Analysis: I will use sequential, selection and repetition programming statements. The program will loop for 10 positive numbers, prompting the user to enter a number. I will define three integer variables: count, value and sum. count will store how many times values greater than 0 are entered. value will store the input. Sum will store the sum of all 10 integers. I will define one double number: avg. avg will store the average of the ten positive integers input. The sum will be calculated by this formula: sum = sum + value For example, if the first value entered was 4 and second was 10: sum = sum + value = 0 + 4 sum = 4 + 10 = 14 Values and sum can be input and calculated within a repetition loop: while count <10 Input value sum = sum + value End while Avg can be calculated by: avg = value/count
  • 2. A selection statement can be used inside the loop to make sure the input value is positive. If value >= 0 then count = count + 1 sum = sum + value Else input value End If ( 7 ) Program Design: Main // This program will calculate the average of 10 integer numbers // Declare variables // Initialize variables // Loop through 10 numbers // Prompt for positive integer // Get input // test input value for gt 0 if (value > 0) //Increment counter //Accumulate sum Else // display msg to enter a positive integer // Prompt for positive integer // Get input Endif // End loop //Calculate average //Print the results (average) End Test Plan: To verify this program is working properly the input values could be used for testing:
  • 3. Test Case Input Expected Output 1 1 1 1 0 1 2 0 1 3 2 Average = 1.2 2 100 100 100 100 -100 Input a positive value 100 200 -200 200 200 Input a positive value 200 200 average is 120.0 NOTE: test #2 has 12 input numbers because there are two negative numbers. Pseudocode: Main // This program will calculate the average of 10 positive integers. // Declare variables Declare count, value, sum as Integer Declare avg as double //Initialize values
  • 4. Set count=0 Set sum = 0 Set avg = 0.0; // Loop through 10 integers While count < 10 Input value If (value >=0) sum = sum + value count=count+1 Else Pr *** Value must be positive *** Input value End if End While // Calculate average avg = sum/count // Print results End //End of Main C Code The following is the C Code that will compile in execute in the online compilers. #include <stdio.h> #include <stdbool.h> // needed for the Boolean variable debug. int main () { /* variable definition: */ int count, value, sum; float avg; bool debug; /* Initialize */ count = 0; sum = 0; avg = 0.0; debug = false;
  • 5. // Loop through to input values while (count < 10) { printf("Enter a positive Integern"); scanf("%d", &value); if (debug) printf(" value is %dn " , value ); //note the value of debug if (value >= 0) { sum = sum + value; count = count + 1; } else { printf("Value must be positiven"); } } // Calculate avg. // Since sum and count are both integers, this will give you an integer division // Hence, we need to either // Declare sum as a float or... // type cast sum as float (as shown below) avg = (float) sum/count; printf("sum is %dn", sum); printf("average is %fn " , avg ); return 0; } Setting up the code and the input parameters in ideone.com: Note the input integer values are 1, 1, 1, 0, 1, 2, 0, 1, 3, 2 for this test case. You can change these values to any valid integer values to match your test cases. You should also test with a negative number to make sure the positive integer logic works properly. Note: the input data needs to be entered into the stdin window separated by a space of new line. Results from running the programming at ideone.com:
  • 6. 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 %.2fn " , 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 %dn " , 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. Loop (Repetition) with Nested selection n statement
  • 7. v Hide Description ( 10/3/2016 ) ( Loop (Repetition) with Nested selection statement - CMIS 102 6386 Introduction to Problem Solving and
  • 8. Algorithm Design (2168) ) Whne {Cost > 0) If (Cost > 150) If (Staff > 12) Fee = 110 Else Fee = 115 Endlf NESTED LOOPS, Ifs Else Fee = 12.0, nplf EndWhi le Part 1: Create a While-End repetition structure that includes a nested if-then selection structure. Provide an overview (i.e. Program Design) of what your repetition structure is doing as well as the Pseudocode. Create a program that handles 150 passengers of an Airline with the following requirements: The first 25 passenger the ticket price is $90. The remaining passengers the ticket price is $100. The first 100 passengers get a ticket. The next 25 (i.e 101- 125) are put on standby. No more passengers are accepted after
  • 9. 125. Print out a message for each of the above categories . Part 2: Convert Discussion 1 to C-code. Don't for get to indent your code. Put Discussion 2 - problem no.X in the Subject area and submit a .txt (or .c) file for your code. 1/2 CurrDate (i.e. 2016mmdd) StartDate (i.e. 2016mmdd) // Mon start of week EndDate (i.e. 2016mmdd) // Sun end of week maxRecs 37 II the number of data records Here is what you have to work with. Don't worry about writing the data, just setting the background color. Hint: you need to compare the Date variables : CurrDate , StartDate, EndDate. What is special about the Yellow background ? To set the Beige background you need to work with prevYear and Year - Year you determine from CurrDate, prevYear you need to set in your loop appropriately. Declare CurrDate, StartDate, EndDate, Year, prevYear, maxRecs, recCount AS Integer Declare bckColor AS String Set recCount = 0 Set prevYear = 0 Set bckColor = "Yellow" Set bckColor = "Pink" Set bckColor = "LgtGreen" Set bckColor = 'DrkGreen" Set bckColor = "Beige" Set recCount = recCount + 1
  • 11. Create an Parallel Arrays PreviousNext Hide Description Parallel Arrays In Pseudocode, declare two 1-dimensional parallel arrays to store the information requested in the problems below. Use a one loop to prompt the user for the information and assign it to the parallel arrays. Then use a second loop to display the values of the parallel arrays. Put Part 1 - problem no. (1,2,3,4,5,6,7,8) in the Subject area. Collect the following information, State and Population You may do additional problems, if you want. Part 2: Convert Discussion 1 to C-code. Don't for get to prototype your function before the main and to define your function after the main. Put Discussion 2 - problem no.X in the Subject area and submit a .txt (or .c) file for your code.