use c code to develop a program In this program you will create a structure called class to hold the information of a class in Seneca college’s buildings. The information required for each class is as follows   Campus name (like newham or Seneca@york) Building name (like  Victor Phillip Dahdaleh Building) floor (like 1 2 3 4 5, …) class code (like DB2109) size of class (40 60 25) has projector (yes/no) has podium (yes/no) has whiteboard (yes/no)     The following is the declaration of the structure   Struct class{ Char campus[101]; Char building[101]; --- --- } Complete the above structure template based on the list of attributes provided   Implement the followinggetClass function that receives a pointer to a vehicle and fills it up with user data. No user input validation is necessary. The user should be properly prompted for each field. Be careful with proper usage of . (dot) operator and -> (arrow) operator as this is the part of the code that gets the mark!   void getClass (struct class* cl)   Implement the followingprintClass    void printClass(struct class cl)   Your function should print the Class in the following format:   Campus: Newham Building: Phillip Dahdaleh Building Floor: 2 Class Code: DB2109 Class Size: 25 Amenities: Projector Podium whiteboard (this will only include Projector if the class doesn’t have podium/whiteboard)     Implement the following function void classCopy(struct class* dest, struct class source) Copies the class in source with all its fields into the class in dest. BE CAREFUL WITH REFERENCE vs VALUE PARAMETERS!   Implement the following function int amenityCount(struct class cl) that gets the a class and using has projector, has podium, has whiteboard fields, returns the number of amenities of that class (0, 1, 2, or 3)   Implement a class compare function with the following prototype: int classCompare(struct class cl1, struct class cl2) That compares two classes with the following rules If cl1wins, returns 1. If cl2 wins returns -1, if the classes are the same returns 0 A class with a bigger capacity always wins If two classes have the same capacity, the class that has more amenities wins If the classes have the same capacity and same number of amenities, they’re equal   Example 1:   Class1: 40 capacity with projector and whiteboard Class2: 50 capacity with projector, whiteboard and podium   Class 2 wins! Example 2:   Class1: 40 capacity with projector and whiteboard Class2: 40 capacity with whiteboard   Class 1 wins!   Example 3:   Class1: 40 capacity with projector and whiteboard Class2: 40 capacity with whiteboard and podium   Equal!

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

 

use c code to develop a program In this program you will create a structure called class to hold the information of a class in Seneca college’s buildings. The information required for each class is as follows

 

Campus name (like newham or Seneca@york)

Building name (like  Victor Phillip Dahdaleh Building)

floor (like 1 2 3 4 5, …)

class code (like DB2109)

size of class (40 60 25)

has projector (yes/no)

has podium (yes/no)

has whiteboard (yes/no)

 

 

The following is the declaration of the structure

 

Struct class{

Char campus[101];

Char building[101];

---

---

}

  • Complete the above structure template based on the list of attributes provided

 

  • Implement the followinggetClass function that receives a pointer to a vehicle and fills it up with user data. No user input validation is necessary. The user should be properly prompted for each field. Be careful with proper usage of . (dot) operator and -> (arrow) operator as this is the part of the code that gets the mark!

 

void getClass (struct class* cl)

 

  • Implement the followingprintClass 

 

void printClass(struct class cl)

 

Your function should print the Class in the following format:

 

Campus: Newham
Building: Phillip Dahdaleh Building

Floor: 2

Class Code: DB2109
Class Size: 25

Amenities: Projector Podium whiteboard (this will only include Projector if the class doesn’t have podium/whiteboard)

 

 

  • Implement the following function
    void classCopy(struct class* dest, struct class source)

Copies the class in source with all its fields into the class in dest.

BE CAREFUL WITH REFERENCE vs VALUE PARAMETERS!

 

  • Implement the following function

int amenityCount(struct class cl)

that gets the a class and using has projector, has podium, has whiteboard fields, returns the number of amenities of that class (0, 1, 2, or 3)

 

  • Implement a class compare function with the following prototype:


int classCompare(struct class cl1, struct class cl2)

That compares two classes with the following rules

  • If cl1wins, returns 1. If cl2 wins returns -1, if the classes are the same returns 0
  • A class with a bigger capacity always wins
  • If two classes have the same capacity, the class that has more amenities wins
  • If the classes have the same capacity and same number of amenities, they’re equal

 

Example 1:

 

Class1: 40 capacity with projector and whiteboard

Class2: 50 capacity with projector, whiteboard and podium

 

Class 2 wins!

Example 2:

 

Class1: 40 capacity with projector and whiteboard

Class2: 40 capacity with whiteboard

 

Class 1 wins!

 

Example 3:

 

Class1: 40 capacity with projector and whiteboard

Class2: 40 capacity with whiteboard and podium

 

Equal!

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
User Defined DataType
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education