Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
Task 1: Define the discount() method and implement the body that displays the message "You are pre-registered and qualify for a 5% discount.".
Define the noDiscount() method and implement the body that displays the message "Sorry, you did not pre-register and do not qualify for a 5% discount.".
The ArtShowDiscount
// ArtShowDiscount.cpp - This program determines if an art show attendee gets a 5% discount for preregistering.
// Input: Interactive
// Output: A statement telling the user if they get a discount or no discount.
#include <iostream>
#include <string>
using namespace std;
void discount();
void noDiscount();
int main()
{
string registerString;
cout << "Did you preregister? Enter Y or N: ";
cin >> registerString;
// Test here. If = Y, call discount(), else call noDiscount().
return 0;
} // End of main function
// Write discount function here
// Write noDiscount function here
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by stepSolved in 2 steps with 2 images
Knowledge Booster
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
- Computer Science Questionarrow_forwardimplement these five methods and main function: 1. getSize() // return the total number of items stored in the bag. Note: DlkdBag does not have itemCount member variable. 2. addFH() //add anEntry from head 3. addFT() //add anEntry from tail 4. display() // display bag items from head to tail 5. clear() // get rid of the bag, and release all memory used by the bag 6. main() // driver code to test all the methods you've implemented Submission: Put everything into a single file, name it as LastNameFirstInitial_a3.cpp (e.g., if your name is John Doearrow_forwardObjective: Write a class that will test dates and times inputted by the user and determine whether or not it is valid. This will focus on the usages of methods to organize code. First download the driver and put it in your project DO NOT ALTER THE DRIVER! Use this to run your project The driver : public class DateAndTimeDriver { public static void main(String[] args) { // TODO Auto-generated method stub DateAndTimeTester dtTester = new DateAndTimeTester(); dtTester.run(); } } Write a class file called DateAndTimeTester This DOES NOT have a main method Create the following methods run: This method returns nothing and takes no parameters. This is called by the driver and should handle all of the input from the Scanner and dialog for the user. isValid: returns true or false if a given String has the correct date and time. The String parameter should be formatted “MM/DD hh:mm” This method should call the methods isValidDate and isValidTime to determine this. isValidDate: returns…arrow_forward
- Assignment using Methods For this exercise, you need to complete all the questions in a single project. You will invoke the methods from your main. Questions 1-6 is due at the end of your next class. Write a method with the following specifications:name: DisplayMenuarguments: nonereturn value: nonetasks: display the following menu choice on the screenCalculation Menu3) Calculate Sum 4) Calculate Sum of Squares5) Calculate Sum of Cubes0) To ExitEnter the number that corresponds to your choice: You may beautify the output to your own likings. You don’t have to implement the functionalities of the various menu choices at this stageCall this method from your main. Modify your main so that the above method is call repeatedly. The program will terminate when the user enters 0. Any other choice should produce an error message. Because you will not be doing any arithmetic you may accept the user response either as an int, or a char or a string. Write a method with the following…arrow_forwardUsing JAVASCRIPT write an object prototype for a Person that has a name and age, has a printInfo method, and also has a method that increments the persons age by 1 each time the method is called. Create two people using the 'new' keyword, and print both of their infos and increment one persons age by 3 years. Use an arrow function for both methods */ // Create our Person Prototype // Use an arrow to create the printInfo method // Create another arrow function for the addAge method that takes a single parameter // Adding to the agearrow_forwardImplement the following class. Refer to the below notes for more details. SimCard phoneNumber: String internationalService: boolean minutes: int // default 0 costPerMinute: double + SimCard ( ) + SimCard ( newPhoneNumber: String, newInternationalService: boolean ) + getters and setters of phoneNumber, internationalService and costPerMinute + callLocal (duration: int): void + callInternational(duration: int): boolean + bill(): double o phoneNumber: private String representing the phone number. Default is "00-000000" o internationalService : private boolean indicating whether international calls are allowed or not. Default is false. o minutes: private int representing the number of minutes to be invoiced (added to the bill). Default is 0. o costPerMinute: private double representing the cost of 1 minute. This value should be positive. Default value is 0.2. Assume all the sim card has the same cost rate per minute. LS) The no-arg constructor that will create a new SimCard with the default…arrow_forward
- java submit as a text dont use others answers please attach screenshot of output Thank you!!!arrow_forwardImage1 is my program, can you separate it to three methods base on the requirements(see image 2)arrow_forwardLook at the header of the method below, and then implement a sample call to it in your code.private static void ShowValue ()arrow_forward
- Can anyone solve this Task in python language?arrow_forwardcreate java method to count the number of employees and their salary ranges according to your assumptions. You can think about any assumption . Create main class to call the methodarrow_forwardPart I Create a Ticket class. The design is up to you. Write the necessary methods. Part II Create a MovieTicket class that inherits from Ticket class. The design is up to you. Write the necessary methods. Part III Create a Theater class. The design is up to you. Write the necessary methods.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
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)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education