Question
5. Write a method that tracks the number of tickets sold to an event. Since there are only 100 seats available, provide protection so the
5. Write a method that tracks the number of tickets sold to an event. Since there are only 100 seats available, provide protection so the number of tickets never goes beyond that. _ ___________________________________________________________ 6. Option: Only 20 students can enroll in Java 1. Assume a field named students starts with the value 20. Write a method that reduces that value whenever a student enrolls. __________________________________________________ _____________________________________________________________________________ 7. Tell the value of a double field named answer after each of these operations. num1 is an int with the value 25; num2 is a double with the value 20: answer = num1 + num2; ________________________________________ answer = num1 num2; _______________________________________ answer = num 1 * num2; _______________________________________ answer = num1 / num2; _______________________________________ answer = num1 % num2;_________________________________________________ 8. Option: Now assume there is an int field named intAnswer. What is the result of this statement. If you dont know, try it. - intAnswer = num1 + num2; ________________
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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