Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

code in solidity Create a college enrollment smart contract named CISEnrollment. For this enrollment system, you will have four total COSC courses on initialization: -

code in solidity image text in transcribed

Create a college enrollment smart contract named "CISEnrollment". For this enrollment system, you will have four total COSC courses on initialization: - 670 (graduate) - 617 (graduate) - 484 (undergraduate) - 431 (undergraduate) The enrollment system will store information for all the students who have enrolled for a course. After creating the contract, we should add the owner of the enrollment system. Below are the minimum function requirements for the enrollment contract: - register (credits, studentType, course): save when a course is registered by a student. A student can only register for one course. Undergraduates can only register for 484 and 431 . Graduate students can register for any course, only if they have over 20 credits, but they are not allowed to register for 431. No class can have more than 30 students registered at a given time. - credits: number - studentType: either graduate or undergraduate - course: either 670, 617, 484, and 431 (this can be a string, number, or something else depending on how your contract is set up) - add (courseNumber, courseType): only the owner can add a new course to the enrollment contract. The owner cannot add a course that already exists (same courseNumber) - courseNumber: course number (i.e. 670) - courseType: either graduate or undergraduate - getRoster (course): log the student addresses enrolled for a given course - OPTIONAL: drop (course): student can drop a course as long as it has been less than 30min since registration Feel free to add appropriate events for the required functions or to add extra functions to enhance your contract. A few notes/hints: - It might be useful to make a student struct. You are not limited to what you can store for a user - You do not need to worry about a student registering for a course that was added by the owner after contract initialization - OPTIONAL: Time in Solidity is simple, check here for a reference Create a college enrollment smart contract named "CISEnrollment". For this enrollment system, you will have four total COSC courses on initialization: - 670 (graduate) - 617 (graduate) - 484 (undergraduate) - 431 (undergraduate) The enrollment system will store information for all the students who have enrolled for a course. After creating the contract, we should add the owner of the enrollment system. Below are the minimum function requirements for the enrollment contract: - register (credits, studentType, course): save when a course is registered by a student. A student can only register for one course. Undergraduates can only register for 484 and 431 . Graduate students can register for any course, only if they have over 20 credits, but they are not allowed to register for 431. No class can have more than 30 students registered at a given time. - credits: number - studentType: either graduate or undergraduate - course: either 670, 617, 484, and 431 (this can be a string, number, or something else depending on how your contract is set up) - add (courseNumber, courseType): only the owner can add a new course to the enrollment contract. The owner cannot add a course that already exists (same courseNumber) - courseNumber: course number (i.e. 670) - courseType: either graduate or undergraduate - getRoster (course): log the student addresses enrolled for a given course - OPTIONAL: drop (course): student can drop a course as long as it has been less than 30min since registration Feel free to add appropriate events for the required functions or to add extra functions to enhance your contract. A few notes/hints: - It might be useful to make a student struct. You are not limited to what you can store for a user - You do not need to worry about a student registering for a course that was added by the owner after contract initialization - OPTIONAL: Time in Solidity is simple, check here for a reference

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

Technical Audit A Thoroughfare Of System Perfection MBTA Management By Technical Audit

Authors: Shankar Bakhsh Srivastava

1st Edition

3848483343, 978-3848483341

More Books

Students also viewed these Accounting questions

Question

Identify different business entities

Answered: 1 week ago