You are on page 1of 2

PROG 8010 – Winter 2023 -test1 06-03-24

Student name:
Student ID:

PART I: programming questions.


Q.1:
Write a C# program that will predict the size of a population of organisms.
The program should ask for the:
a. starting number of organisms – input 100
b. their average daily population increase (as a percentage) – input 50
c. and the number of days they will multiply – input 3

Sample
Day 1 Organisms Size 100
Day 2 Organisms Size 150
Day 3 Organisms Size 225

. For example, a population might begin with two organisms, have an average daily increase of
50 percent, and will be allowed to multiply for 14 days. The program should use a loop to
display the size of the population for each day.

-Input Validation: Do not accept a number less than 2 for the starting size of the population.
Do not accept a negative number for average daily population increase. Do not accept a
number less than 1 for the number of days they will multiply.
-Ask the user if they want to run the app. again.

Q.2:
A professor wants to create a gradebook of all the activities for the class. The gradebook has
assigned numbers to the activities (1: exams, 2: tests, 3: activities, 4: tests).
Also, the gradebook has already assigned 10% of the total calculated grade to (participation).
Here is a sample list of the activities and their weights as follows:
activity weight
1 20
1 20
2 10
3 10
4 10
For example, when the gradebook reaches at least the 72% (including the participation) of
the total weight (100%), the remaining weight is assigned to the course project activity.
Develop a C# app that inputs one gradebook’s activities, then:
a. Calculate and displays the number of each activity,
b. Calculate and displays the activities total weight
c. Calculate and displays the total weight of the course in the gradebook which should add
up to 100%.
There is no limit to the number of activities that can be created in the gradebook by a
professor.
- Input Validation: Do not accept zero or negative numbers for the user inputs.
- Ask the user if they want to run the app. again.

Instructions:
- Submission details are on d2l.
- Rubrics: All standard coding practices done in class, all requirements are
met, simplicity/code is easy to follow and understand, proper naming
conventions, using comments, proper code indentation, correct
inputs/outputs (inputs validation is required).

You might also like