Amobile
Amobile
*;
/**
* Mobile Store Management System
* This program simulates a simple mobile store management system.
* Users can view mobile details, add new mobile details, and generate customer bills.
*/
public class Mobile {
/**
* Main method - Entry point of the program.
* Provides a menu-driven interface for managing mobile store operations.
*/
public static void main() {
Scanner sc = new Scanner(System.in);
int flag = 0; // Control variable for exiting the program
while (flag == 0) {
System.out.println('\f'); // Clear screen
System.out.println("Developed by Software Development Group....");
heading('-'); // Display heading
System.out.println("WELCOME TO THE BEST MOBILE STORE");
heading('-');
int n2 = 0;
switch (n2) {
case 1:
// Display mobile details
displayMobileDetails();
break;
case 2:
// Add new mobile details
add();
break;
case 3:
// Generate customer bill
bill();
break;
case 4:
// Exit the program
flag = 1;
break;
default:
System.out.println("Invalid Input");
}
if (flag == 1) break;
}
}
/**
* Displays a heading line with a specified character.
*
* @param hd Character to use for the heading line.
*/
public static void heading(char hd) {
for (int hd1 = 0; hd1 <= 80; hd1++) {
System.out.print(hd);
}
System.out.println();
}
/**
* Prompts the user to press a key to continue.
*/
public static void pressKey() {
Scanner sc = new Scanner(System.in);
int ar = 0;
while (true) {
System.out.println("Press 1 to continue....");
ar = sc.nextInt();
if (ar == 1) break;
}
}
/**
* Adds a new mobile to the store's inventory.
*/
public static void add() {
Scanner sc = new Scanner(System.in);
System.out.println('\f');
heading('-');
System.out.println("WELCOME TO THE BEST MOBILE STORE");
heading('-');
while (!sc.hasNextInt()) {
System.out.print("Please enter numeric price: ");
sc.next();
}
pr = sc.nextInt();
heading('-');
pressKey();
}
/**
* Generates a customer bill.
*/
public static void bill() {
// Implementation for billing...
}
/**
* Displays details of all available mobiles.
*/
public static void displayMobileDetails() {
System.out.println('\f');
heading('-');
System.out.println("WELCOME TO THE BEST MOBILE STORE");
heading('-');
System.out.println("Brand \t\t\t Model \t\t\t\t Price");
heading('=');
heading('=');
pressKey();
}
}