Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part 1: Create a class named App representing a mobile app for a mobile with the following data members: - App's name: represent a name

Part 1: Create a class named App representing a mobile app for a mobile with the following data members: - App's name: represent a name of a app. Default is "". - Rate: a floating-point number represent app's rate. (App's rate should be between 0 and 5). Default is 0 . - Number of downloads: an integer number represent number of downloads per app (must be greater than or equal to zero). Default is 1 . Please use appropriate data type for each data members. Additionally, the class should also include the following methods: - A default constructor to initialize the data members. - A constructor with parameters to initialize the data members. Please provide an error message when the user send an invalid data values and assign a default value instead. - A set method named setApp to set all data member. Please provide an error message when a user sends an invalid data values. (Note: do not set current class's members to default here if the user provide an invalid one, just do not change it). - Three get methods to get each data members. - A method named print to print a app's information. Part 2: Create a main and make sure to do the following - Ask the user to enter app's information. - Create an object of type App. - set the object using the set method. - Use print method to print the app's information.
image text in transcribed
image text in transcribed
Part 1: Create a class named App representing a mobile app for a mobile with the following data members: - App's name: represent a name of a app. Default is "'". - Rate: a floating-point number represent app's rate. (App's rate should be between 0 and 5). Default is 0 . - Number of downloads: an integer number represent number of downloads per app (must be greater than or equal to zero). Default is 1 . Please use appropriate data type for each data members. Additionally, the class should also include the following methods: - A default constructor to initialize the data members. - A constructor with parameters to initialize the data members. Please provide an error message when the user send an invalid data values and assign a default value instead. - A set method named setApp to set all data member. Please provide an error message when a user sends an invalid data values. (Note: do not set current class's members to default here if the user provide an invalid one, just do not change it). - Three get methods to get each data members. - A method named print to print a app's information. Part 2: Create a main and make sure to do the following - Ask the user to enter app's information. - Create an object of type App. - set the object using the set method. - Use print method to print the app's information. Part 1: Create a class named App representing a mobile app for a mobile with the following data members: - App's name: represent a name of a app. Default is "'". - Rate: a floating-point number represent app's rate. (App's rate should be between 0 and 5). Default is 0 . - Number of downloads: an integer number represent number of downloads per app (must be greater than or equal to zero). Default is 1 . Please use appropriate data type for each data members. Additionally, the class should also include the following methods: - A default constructor to initialize the data members. - A constructor with parameters to initialize the data members. Please provide an error message when the user send an invalid data values and assign a default value instead. - A set method named setApp to set all data member. Please provide an error message when a user sends an invalid data values. (Note: do not set current class's members to default here if the user provide an invalid one, just do not change it). - Three get methods to get each data members. - A method named print to print a app's information. Part 2: Create a main and make sure to do the following - Ask the user to enter app's information. - Create an object of type App. - set the object using the set method. - Use print method to print the app's information

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions