needs to be in basic pseudocode. with no specific language. 1) Our college’s Wor
ID: 3869036 • Letter: N
Question
needs to be in basic pseudocode. with no specific language.
1) Our college’s Workforce Solutions department offers non-credit classes in various areas of interest in the community, as shown below, along with their fees.
Class Number
Class Name
Fee
1 Acrylic Painting for Beginners $79.00
2 Advanced Photography $115.00
3 Basic Photography $115.00
4 Blues and Boogie Woogie Piano $85.00
5 Public Speaking and Speech Giving $99.00
6 Sign Language Level I $49.00
Assume that the following declarations have already been made
num totalEnrollment
num averageEnrollment
num highestEnrollment
num lowestEnrollment
num indexOfHighest
num indexOfLowest
num classNumber
num desiredClassNumber
a) Declare any required variables and constants, and arrays for the class names, the fees and the enrollment count for each class. The table above shows only the current group of classes that have been scheduled. The program must be capable of being modified to accommodate more or fewer classes later by editing only one line of code.
b) Assume that the class name and fee arrays have been filled. You do not have to write code to fill them.
c) The program should continuously accept a class number and then display the class’s name, until the user enters an appropriate sentinel value to stop entering input. Each time the user enters a valid class number, the program asks the user if he/she wants to sign up for the class, and if they do, simply updates the count of people who have signed up for the class.
d) Once the user decides to stop, the program should display
i) each class number, name and fee Page 2 of 3
ii) a count of the number of people signed up for each class
iii) the total number of people signed up for classes
iv) the average class enrollment
v) the names of the highest enrolling class and the lowest enrolling class – this should be done without any sorting
Explanation / Answer
#include <stdlib.h>
#include <stdio.h>
int main( void ) {
int i, fibonacci[ 20 ];
fibonacci[ 0 ] = 0;
fibonacci[ 1 ] = 1;
for( i = 2; i < 20; i++ )
fibonacci[ i ] = fibonacci[ i - 2 ] + fibonacci[ i - 1 ];
for( i = 0; i < 20; i++ )
printf( "Fibonacci[ %d ] = %f ", i, fibonacci[ i ] );
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.