Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

USING C LANGUAGE USE stdio.h only DO NOT USE GLOBAL VARIABLES DO NOT USE ARRAYS, STRUCTS OR UNIONS USE LOOP STATEMENTS USE int and float

USING C LANGUAGE

USE stdio.h only DO NOT USE GLOBAL VARIABLES DO NOT USE ARRAYS, STRUCTS OR UNIONS USE LOOP STATEMENTS USE int and float only CREATE A FUNCTION

image text in transcribed

3. All students at the Green Aim High University are required to have their IDs scanned at the University's entrance gates where a sensor is able to capture the student's ID number. Each ID is encoded as a 9-digit integer. The first four digits represent the student's year of entry. The fifth digit is an odd number only if the student is a male student, otherwise it is either o or an even number. The remaining four digits are not relevant in this programming problem. Example ID numbers: 201601243 means 2016 year of entry, female student 201714569 means 2017 year of entry, male student. Write a C program that will input the ID numbers and output some information for a particular gate. The program should ask the user to input an integer value corresponding to the scanned ID number. Assume that all inputs are valid. The program should keep on asking for input until the sentinel value of zero is entered. Note that zero is not a valid ID number but is used to signal the end of input, which in this case means that the school day is over and that the university is closing its gates. Assume that at least one student entered the gate. After a zero input, the program should print the following values, one value per line of output. Number of times that IDs were scanned How many percent were females How many percent were first year students (note: a first year student has an ID number starting with 2020) For example, let us assume that 99 students entered the gate - 33 were females and 66 were freshmen. The program's output should be as follows. Note that the last two values should be formatted with 2 digits after the decimal point. 99 33.33 66.67

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning Microsoft SQL Server 2012 Programming

Authors: Paul Atkinson, Robert Vieira

1st Edition

1118102282, 9781118102282

More Books

Students also viewed these Databases questions

Question

List out some inventory management techniques.

Answered: 1 week ago

Question

How do Dimensional Database Models differ from Relational Models?

Answered: 1 week ago

Question

What type of processing do Relational Databases support?

Answered: 1 week ago

Question

Describe several aggregation operators.

Answered: 1 week ago