so im working on a final project for my intro to java-oop class. We recently made the jump to OOP and its a bit confusing. This program needs to have 1 main class and 3 regular classes. its supposed to be a movie production program. It needs to have a initial investment as well as a cast and there budget then a box office return followed by the planning of a sequel with the budget for the sequel based on the box office return. Theres a little more to it but thats the idea. there should be two options for the cast which is actor, actress,director. I built a program and took it to class and basically though i was building some objects it was very much a structured program. So I started over and this is what I have right now
Main class:
public class MovieProducer { public static void main(String args[]){ Cast actor1 = new Cast ("Actor", "Tom Wise", 2000000); Cast actress1 = new Cast ("Actress", "Lana Elles", 1000000); Cast director1 = new Cast ("Director", "Mike Powers", 1500000); double initInv= 5000000;// initial investment double boxReturn= 4000000; double actorCost = actor1.getCost(); double actressCost = actress1.getCost(); double directorCost = director1.getCost(); Account movie1 = new Account(initInv, boxReturn, actorCost, actressCost, directorCost); System.out.println( "First Movie"); System.out.println( ""); System.out.println( "The role of: "+ actor1.printString()); System.out.println( "The role of: "+ actress1.printString()); System.out.println( "The role of: "+ director1.printString()); System.out.println( ""); System.out.println( "The Total cost of the crew is: "+ movie1.AddCosts()); System.out.println( "The Initial Investment is: "+ movie1.getInvestment()); System.out.println( "The Box office return is: "+ movie1.getBoxReturn()); System.out.println( "The Gain or Loss on this movie is: "+ movie1.Add()); System.out.println( "Your next Movie budget will be: "+ movie1.NextBudget()); // Second movie object: Cast actor2 = new Cast ("Actor", "Les Clay", 1000000); Cast actress2 = new Cast ("Actress", "Amber May", 1000000); Cast director2 = new Cast ("Director", "Bill Wes", 2000000); double inv2 = movie1.NextBudget();// second investment double boxReturn2= 4750000; double actorCost2 = actor2.getCost(); double actressCost2 = actress2.getCost(); double directorCost2 = director2.getCost(); Account movie2 = new Account(inv2, boxReturn2, actorCost2, actressCost2, directorCost2); System.out.println( ""); System.out.println( "Second Movie"); System.out.println( ""); System.out.println( "The role of: "+ actor2.printString()); System.out.println( "The role of: "+ actress2.printString()); System.out.println( "The role of: "+ director2.printString()); System.out.println( ""); System.out.println( "The Initial Investment is: "+ movie2.getInvestment()); System.out.println( "The Total cost of the crew is: "+ movie2.AddCosts()); System.out.println( "The Box office return is: "+ movie2.getBoxReturn()); System.out.println( "The Gain or Loss on this movie is: "+ movie2.Add()); System.out.println( "Your next Movie budget will be: "+ movie2.NextBudget()); //Movie nextMovie= new Movie(actor1.getName(),actor2.getName(),actress2.getName(),director2.getName(),actor1.getCost(),actor2.getCost(),actress1.getCost(), director1.getCost(),movie1.getInvestment()); }}
Cast class:
Account class:public class Cast { String role; String name; double cost; // constructor Cast(String role, String name, double cost) { this.role= role ; this.name= name; this.cost = cost; } // Get role public String getRole(){ return role; } // Set Role. public void setRole(String tempRole){ role = tempRole; } //Get name public String getName(){ return name; } // Set name. public void setName(String tempName){ name = tempName; } //Get cost public double getCost(){ return cost; } // Set cost. public void setCost(double tempCost){ cost = tempCost; } String printString(){// return ((role) + " will be cast with: " + (name)+" at a price of: $"+(cost));} }
public class Account { double invest; double bOReturn; double actorCost; double actressCost; double directorCost; double nextBudget=0; // constructor Account(double invest, double bOReturn, double actorCost, double actressCost, double directorCost) { this.invest= invest ; this.bOReturn= bOReturn; this.actorCost= actorCost; this.actressCost= actressCost; this.directorCost = directorCost; } // Get role public double getInvestment(){ return invest; } // Set Role. public void setInvestment(double tempInvest){ invest= tempInvest; } //Get role public double getBoxReturn(){ return bOReturn; } //Set Role. public void setBoxReturn(double tempBox){ bOReturn= tempBox; } double AddCosts(){ double remainBud= (actorCost+ actressCost + directorCost); return remainBud; } double Add(){ double gainOrLoss = (bOReturn)- (invest); return gainOrLoss; } double NextBudget(){ if (bOReturn < invest){ nextBudget=bOReturn;} else if(bOReturn > invest){ nextBudget=bOReturn;} else { nextBudget=invest;} return nextBudget;} /*double decideActor(){ double actorFinal=0; if( nextBud < (actorCost+ actressCost + directorCost) ){*/ }
Im not sure if im following oop design like im supposed to, and I dont want to go any further until i know if im doing it correctly, plus Im stuck on the next part so I wanted to get this correct. Any help or suggestion would greatly be apreciated