import java.util.*;
class moviesforrent
{
public static void main (String args[])
{
Scanner in = new Scanner (System.in);
String mname;
System.out.print ("\n\t Enter the movie name = ");
mname=in.nextLine();
movies ob = new movies();
ob.pricendetail(mname);
}
}
class movies
{
String ma[] = new String [4];
String mc[] = new String [4];
//price per week=RM10.
movies()
{
ma[0]="fast&furious";
ma[1]="pearl harbor";
ma[2]="death note";
ma[3]="ratatouille";
mc[0]="Josh Hartnett";
mc[1]="Ben Affleck";
mc[2]="Michael Bays";
mc[3]="Jerry Bruckheimer";
}
void pricendetail(String mname)
{
int i=0,j=0;
while (i<4)
{
if (mname.equals(ma[i]))
{
System.out.println ("\n\t Movie: "+mname+" \n\t Main character: "+mc[i]+"\n\t Price per week = RM 10.00");
j=1;
break;
}
++i;
}
if (j==0)
System.out.println ("\n\t "+mname+" is not available.");
}
}
class moviesforrent
{
public static void main (String args[])
{
Scanner in = new Scanner (System.in);
String mname;
System.out.print ("\n\t Enter the movie name = ");
mname=in.nextLine();
movies ob = new movies();
ob.pricendetail(mname);
}
}
class movies
{
String ma[] = new String [4];
String mc[] = new String [4];
//price per week=RM10.
movies()
{
ma[0]="fast&furious";
ma[1]="pearl harbor";
ma[2]="death note";
ma[3]="ratatouille";
mc[0]="Josh Hartnett";
mc[1]="Ben Affleck";
mc[2]="Michael Bays";
mc[3]="Jerry Bruckheimer";
}
void pricendetail(String mname)
{
int i=0,j=0;
while (i<4)
{
if (mname.equals(ma[i]))
{
System.out.println ("\n\t Movie: "+mname+" \n\t Main character: "+mc[i]+"\n\t Price per week = RM 10.00");
j=1;
break;
}
++i;
}
if (j==0)
System.out.println ("\n\t "+mname+" is not available.");
}
}
may I know, what is the output ?
ReplyDeleteHere is output of the program:
ReplyDeleteEnter the movie name = fast&furious
Movie: fast&furious
Main character: Josh Hartnett
Price per week = RM 10.00
I hope you got it.
sir can you please send me this program with using constuctors and destructors
Deleteplease give me the report of this project
ReplyDeleteWhat kind of report do you need?
ReplyDeletecan you please publish this program with constructors and destructors
DeleteMovie Store – Manage video rentals and controls when videos are checked out, due to return, overdue fees and for added complexity create a summary of those accounts which are overdue for contact.
ReplyDeletekalaw soalan ni blh pakai ke cooding tu?
yes.,please give me an idea in writing code for managing video rentals and controls when videos are checked out, due to return, overdue fees and for added complexity create a summary of those accounts which are overdue for contact.
Deleteanyone can please send me this program using constructors and destructors
ReplyDeleteanyone can please publish this program with constructors and destructors
ReplyDelete