0% found this document useful (0 votes)
29 views

Averagerating Checked Videoname: Import Class Int Boolean True Void

This document defines a Video class and VideoStore class to model a video rental inventory system. The Video class stores information about a single video like its rating, and defines methods for renting, getting ratings, checking status, and returning videos. The VideoStore class extends Video and defines methods for adding videos to its inventory list, receiving ratings, and returning videos. The main method displays menus for users to view inventory, rent, rate and return videos, or for admins to view inventory or add new videos.

Uploaded by

himanshu
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Averagerating Checked Videoname: Import Class Int Boolean True Void

This document defines a Video class and VideoStore class to model a video rental inventory system. The Video class stores information about a single video like its rating, and defines methods for renting, getting ratings, checking status, and returning videos. The VideoStore class extends Video and defines methods for adding videos to its inventory list, receiving ratings, and returning videos. The main method displays menus for users to view inventory, rent, rate and return videos, or for admins to view inventory or add new videos.

Uploaded by

himanshu
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

import java.util.

*;
class Video
{
int averageRating;
boolean checked=true;
String videoName;
void rent()
{

}
void getRating()
{}
void checked() {}
void returned() {}
}

class VideoStore extends Video{


String inventorylist[]=new String[50];
int i;
void addVideo(String name)
{

}
void recieveRating(String name,int rating) {}
void returnedVideo(String name){}
void inventoryList()
{
if(inventorylist.length<=0)
System.out.println("List is Empty");

else
{
for(i=0;i<inventorylist.length;i++)
{
System.out.println("Video name"+inventorylist[i]+"\trating
"+averageRating);

}
}
}
}
public class VideoRentalInventorySystem
{
public static void main(String []args)
{

String videoname;
VideoStore vs1=new VideoStore();
Video v1=new Video();
System.out.println("Are You A User or Admin?\n1.U for User \n2.A for Admin.");
Scanner sc=new Scanner(System.in);
char ch=sc.nextLine().charAt(0);
if(ch=='U')
{
System.out.println("ENTER YOUR CHOICE:\n1.Display Inventory List\n2.rent
video\n3.give rating\n4.return the video\n5.exit\n");
int choice1=sc.nextInt();
switch(choice1)
{
case 1:
break;
case 2:
break;
case 3: break;

}
}
else if(ch=='A')
{
System.out.println("ENTER YOUR CHOICE:\n1.Display Inventory List\n2.Add
video\n3.Exit\n");
int choice2=sc.nextInt();
switch(choice2)
{
case 1:vs1.inventoryList();
break;
case 2:System.out.print("enter the name of video");
videoname=sc.next();
vs1.addVideo(videoname);
break;
case 3: break;

You might also like