Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Homework 2 4 : ( VBA code ) Vehicle Class Obiects Create a new class module called Vehicle. Each Vehicle object has the following attributes:
Homework :VBA code Vehicle Class Obiects Create a new class module called Vehicle. Each Vehicle object has the following attributes: numwheels integer topspeed double seating capacity integer mpg double horsepower double and licenseplate string Write a method that assigns the attributes of a sedan: wheels, mph top speed, seating capacity, and CAR license plate. Write a method that assigns the attributes of a pickup truck: wheels, mph top speed, seating capacity, and TRK license plate. Write a method that assigns the attributes of a super car: wheels, mph top speed, seating capacity, and GO FAST license plate. Write a method that assigns the attributes of a semi truck: wheels, mph top speed, seating capacity, and LG HAUL license plate. Write a method that assigns the attributes of a school bus: wheels, mph top speed, seating capacity, mpg hp and KUL BUS license plate. Write a method that assigns the attributes of a motorcycle: wheels, mph top speed, seating capacity, and VRO OOM license plate Next, we are going to create a drop down menu for cells AO AO and AO that allows the user to select the vehicle type for Vehicle objects. Go to Data Data Tools Data Validation Settings Allow List. Select the cells AR:AR for the source of the drop down list. Now, write a sub that creates vehicle objects and calls the methods written above based off when the user selected from the drop down lists. Then, using the properties of the objects output the following to the spreadsheet License plate of the fastest vehicle The average mpg of the vehicles The total seats across all vehicles The total horsepower per wheel total horsepower total wheels See the instructor example on the screen. tableVehicle Class Object,Vehicle Vehicle Vehicle Fast License Plate,Average MPGTotal Seating,HP per Wheel, Assign Vehicles Dropdown list input Sedan Pickup Truck Super Car Semi Truck School Bus Motorcycle
Homework :VBA code Vehicle Class Obiects
Create a new class module called Vehicle. Each Vehicle object has the following attributes: numwheels integer topspeed double seating capacity integer mpg double horsepower double and licenseplate string
Write a method that assigns the attributes of a sedan: wheels, mph top speed, seating capacity, and CAR license plate.
Write a method that assigns the attributes of a pickup truck: wheels, mph top speed, seating capacity, and TRK license plate.
Write a method that assigns the attributes of a super car: wheels, mph top speed, seating capacity, and GO FAST license plate.
Write a method that assigns the attributes of a semi truck: wheels, mph top speed, seating capacity, and LG HAUL license plate.
Write a method that assigns the attributes of a school bus: wheels, mph top speed, seating capacity, mpg hp and KUL BUS license plate.
Write a method that assigns the attributes of a motorcycle: wheels, mph top speed, seating capacity, and VRO OOM license plate
Next, we are going to create a drop down menu for cells AO AO and AO that allows the user to select the vehicle type for Vehicle objects. Go to Data Data Tools Data Validation Settings Allow List. Select the cells AR:AR for the source of the drop down list.
Now, write a sub that creates vehicle objects and calls the methods written above based off when the user selected from the drop down lists. Then, using the properties of the objects output the following to the spreadsheet
License plate of the fastest vehicle
The average mpg of the vehicles
The total seats across all vehicles
The total horsepower per wheel total horsepower total wheels
See the instructor example on the screen.
tableVehicle Class Object,Vehicle Vehicle Vehicle Fast License Plate,Average MPGTotal Seating,HP per Wheel,
Assign Vehicles
Dropdown list input
Sedan
Pickup Truck
Super Car
Semi Truck
School Bus
Motorcycle
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started