LE 7.2


/********************************Movie.java***************************/
import java.util.Scanner;
public class Movie {
private String movieTitle;
private String genre;
private String releaseYear;
private double priceTicket;
private double budget;
public Movie() {
}
public void inputData(Scanner scan) {
System.out.print("Enter the movie
title:");
movieTitle = scan.nextLine();
System.out.print("Enter the movie's
Genre: ");
genre = scan.nextLine();
System.out.print("Enter the Movie's
release year: ");
releaseYear =
scan.nextLine();
System.out.print("Enter the price
of movie ticket: ");
priceTicket =
scan.nextDouble();
System.out.print("Enter the movie's
production budget without the\ntrailing Zeroes, e.g. $5,000,000 is
entered as 5: ");
budget = scan.nextDouble();
scan.close();
}
public void printData() {
System.out.println("\nMOVIE
BREAK-EVEN POINT IN TICKETS\n***Basis: $"+priceTicket+" per
Ticket****\n");
System.out.println("Movie:
"+movieTitle);
System.out.println("Year Released:
"+releaseYear);
System.out.println("Genre:
"+genre);
System.out.println("Production
Budget: $"+budget+" million");
System.out.println("Break-Even
Ticket Sales: "+(int)((budget*100000)/priceTicket));
}
}
/**********************************YourLastNameFirstInitialLE.java***************************/
import java.util.Scanner;
public class YourLastNameFirstInitialLE72 {
public static void main(String[] args) {
Movie movie = new Movie();
Scanner Scan = new
Scanner(System.in);
movie.inputData(Scan);
movie.printData();
}
}
/************************output*****************************/
Enter the movie title:How to Train Your Dragon: The Hidden
World
Enter the movie's Genre: Animation
Enter the Movie's release year: 2019
Enter the price of movie ticket: 9
Enter the movie's production budget without the
trailing Zeroes, e.g. $5,000,000 is entered as 5: 129
MOVIE BREAK-EVEN POINT IN TICKETS
***Basis: $9.0 per Ticket****
Movie: How to Train Your Dragon: The Hidden World
Year Released: 2019
Genre: Animation
Production Budget: $129.0 million
Break-Even Ticket Sales: 1433333
![B ConsoleX <terminated> YourLastNameFirstlnitialLE72 [Java Application] C:\Program FilesJava\jre1 Enter the movie title:How t](http://img.homeworklib.com/images/7bc85048-b0a3-423c-bcfc-3038ac6fc444.png?x-oss-process=image/resize,w_560)
Thanks a lot, Please let me know if you have any
problem................
Purpose: To learn how to create and use stand-alone class programs (classes withouta main method)...
Lab Exercise 5.2 Instructions: Name the program toMoviesYourLastNameFirstInitialLE52.java. The only class variable will be for the Scanner class. setMovieTitle(): Prompts for the title of the movie, and returns it from the keyboard. setYearReleased(): Prompts for the year in which the movie was released, and returns it from the keyboard. setMovieGenre(): Prompts for the type or category of the movie: action, animation, comedy, crime, documentary, drama, and returns it from the keyboard. setTicketPrice(): Prompts for the price of a movie ticket,...
Help! Not sure how to create this java program to run efficiently. Current code and assignment attached. Assignment :Write a class Movies.java that reads in a movie list file (movies.txt). The file must contain the following fields: name, genre, and time. Provide the user with the options to sort on each field. Allow the user to continue to sort the list until they enter the exit option. ---------------------------------------------------------- import java.util.*; import java.io.*; public class Movies { String movieTitle; String movieGenre;...
LE 7.1 Create a separate class called Family. This class will have NO main(). Insert a default constructor in the Family class. This is a method that is empty and its header looks like this: public NameOfClass() Except, for the main(), take all the other methods in LE 6.2 and put them in the Family class. Transfer the class variables from LE 6.2 to Family. Strip the word static from the class variables and the method headers in the Family...
IS 2031: LE 7.1 Lab Day DUE D M 4/22/19 Sections 001, 002, 003 Purpose: To learn how to create a class, instantiate an object of the class in another class, and use that object to call methods. Prop Work: Read chapter 7. Refer to coding created or reviewed in your IS 2033 class. Lab Exercise 7.1 Instructions: Name your program as YourLastNameFirstinitialLE71 java. From the code in LE 6.2, do the following: 1. You will NOT be changing any...
MEDIA INHERITANCE - C++ You will create an inheritance set of classes. Use proper rules for data types, class definitions, and inheritance (check input/output of data below). You will create a super media class that will define a general form of media. A media properties will consist of the name and price. The media should be able to construct itself out of the arguments sent to it, virtually print both data fields labeled (price to two decimal places) and overload...
Create a CalculatorTest class that contains the main method. 1. Get two double numbers as input and create an object of the ScientificCalculator Class with those two numbers. 2. Then call the 8 operations one by one sequentially and display the result. Code must be written in Java. (Sample input/output: Enter number 1: 2 Enter number 2: 3 Add() result is : 5 Sub() result is: -1 ……. Power() result is: 8 …… sqrtNum1 result is:) The Problem: Given the...
MUST BE WRITTEN IN C++ Objective: Learn how to define structures and classes, create and access a vector of structures, use sort with different compare functions. Assignment: Your program will use the same input file, but you will print the whole book information, not just the title. And, most importantly, this time you will take an object oriented approach to this problem. Detailed specifications: Define a class named Collection, in which you will define a structure that can hold book...
MUST BE WRITTEN IN C++ Objective: Learn how to define structures and classes, create and access a vector of structures, use sort with different compare functions. Assignment: Your program will use the same input file, but you will print the whole book information, not just the title. And, most importantly, this time you will take an object oriented approach to this problem. Detailed specifications: Define a class named Collection, in which you will define a structure that can hold book...
Queues and Stacks Purpose: To review queues and stacks in Java, and to use the built-in Stack class and Queue interface. The Stack class is a generic class containing these methods: public void push(E value) - pushes a new value onto the Stack public E pop() - pops the next value off of the stack and returns it; throws EmptyStackExceptionl if stack is empty public E peek() - returns the next value on the Stack but does not pop it...
C++ program Correctly complete the following assignment. Follow all directions. The main purpose is to show super and sub class relationships with an array of super media pointers to sub class objects and dynamic binding. The < operator will be overloaded in the super class so all subclasses can use it. The selection sort method will be in the main .cpp file because it will sort the array created in main. The final .cpp file, the three .h header class...