Coder
The Coder is an institution for programming language.
24/07/2025
Working on Coder & AccoTax
05/03/2024
শুভ বিবাহবার্ষিকীর অনেক অনেক শুভেচ্ছা। তোদের জন্য অনেক ভালোবাসা।
16/10/2019
Typical Device Breakpoints
There are tons of screens and devices with different heights and widths, so it is hard to create an exact breakpoint for each device. To keep things simple you could target five groups:
/* Extra small devices (phones, 600px and down) */
only screen and (max-width: 600px) {...}
/* Small devices (portrait tablets and large phones, 600px and up) */
only screen and (min-width: 600px) {...}
/* Medium devices (landscape tablets, 768px and up) */
only screen and (min-width: 768px) {...}
/* Large devices (laptops/desktops, 992px and up) */
only screen and (min-width: 992px) {...}
/* Extra large devices (large laptops and desktops, 1200px and up) */
only screen and (min-width: 1200px) {...}
package ticketbookingx;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;
public class TicketBookingX {
public static void main(String[] args) {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int x = 0x2713;
String emptySeat = " [" + (char) x + "] ";
String bookedSeat = " [x] ";
String savedPassword = "1234";
Scanner sn = new Scanner(System.in);
int passwordAttempt = 3;
//login area
while (passwordAttempt > 0) {
System.out.print("Enter your Password: ");
String password = sn.nextLine();
if (password.equals(savedPassword)) {
break;
}
passwordAttempt--;
if (passwordAttempt == 0) {
System.out.println("No attempt remaining, system suspended");
return;
}
System.out.println("Wrong password, remaining attempt: " + passwordAttempt);
}
System.out.println("Welcome to Hell Hall Booking system!");
//infinite loop for main area
int choice;
boolean[][] seats; // reference of a two dimension array
//allocating memory for seats array
seats = new boolean[10][10];
//initialising front array using loop and inner loop
for (int i = 0; i < seats.length; i++) {
for (int j = 0; j < seats[i].length; j++) {
seats[i][j] = true;
}
}
do {
System.out.println("Main Menu");
System.out.println("1. View Hall");
System.out.println("2. Book Ticket");
System.out.println("3. Exit");
try {
System.out.println("Enter your choice: ");
choice = Integer.parseInt(br.readLine());
switch (choice) {
case 1:
System.out.println("Showing front area:");
char rowID = 'J';
System.out.print(" ");
for (int i = 0; i < seats[0].length; i++) {
System.out.print("\t [" + (i + 1) + "] ");
}
System.out.println("");
for (int i = 0; i < seats.length; i++) {
System.out.print(rowID--);
for (int j = 0; j < seats[i].length; j++) {
if (seats[i][j]) {
System.out.print("\t" + emptySeat);
} else {
System.out.print("\t" + bookedSeat);
}
}
System.out.println("");
}
System.out.println("\n\n\t|--------------------------------S-C-R-E-E-N--------------------------------|");
break;
case 2:
char rowType=' ';
do {
System.out.println("f. Front");
System.out.println("r. Rear");
System.out.println("d. Deluxe");
System.out.println("x. Goto Main Menu");
System.out.print("Enter Seat Type: ");
try {
rowType = sn.next().toLowerCase().charAt(0);
if(!(rowType=='f' || rowType=='r' || rowType=='d' || rowType=='x')){
throw new Exception("Wrong input");
}
} catch (Exception e) {
System.out.println(e.getMessage());
continue;
}
if (rowType == 'x') {
break;
}
System.out.println("Your selection is: " + rowType);
System.out.println("Number of empty seats are: " + getNumberOfEmptySeats(seats, rowType));
System.out.println("Enter number of seats");
int numberOfSeatsRequired = sn.nextInt();
if (numberOfSeatsRequired > getNumberOfEmptySeats(seats, rowType)) {
System.out.println("Not enough seats");
continue;
}
System.out.println("Total Cost is: " + (numberOfSeatsRequired * getRateByRowByType(rowType)));
int temp = numberOfSeatsRequired;
int temp_row = 0;
if (rowType == 'f') {
temp_row = 7;
}
if (rowType == 'r') {
temp_row = 3;
}
if (rowType == 'd') {
temp_row = 0;
}
int temp_col = 9;
while (temp > 0) {
if (seats[temp_row][temp_col] == false) {
temp_col--;
if (temp_col < 0) {
temp_row++;
temp_col = 9;
}
continue;
}
seats[temp_row][temp_col] = false;
String seatNumber = "" + (char) (74 - temp_row);
System.out.println(seatNumber + (temp_col + 1));
temp--;
temp_col--;
if (temp_col < 0) {
temp_row++;
temp_col = 9;
}
}
} while (true);
break;
case 3:
System.out.println("Thank you for using Hell Booking System");
return; // return will close the program.
default:
System.out.println("Wrong input, Enter again");
}
} catch (Exception e) {
System.out.println("Error in input, " + e.getMessage());
choice = 0;
}
} while (true);
}
public static int getRateByRowByType(char rowType) {
switch (rowType) {
case 'f':
return 100;
case 'r':
return 150;
case 'd':
return 300;
default:
return -1;
}
}
public static int getNumberOfEmptySeats(boolean[][] seats, char rowType) {
int count = 0;
int startRow, endRow;
if (rowType == 'f') {
startRow = 7;
endRow = 9;
} else if (rowType == 'r') {
startRow = 3;
endRow = 6;
} else if (rowType == 'd') {
startRow = 0;
endRow = 2;
} else {
return -1;
}
for (int i = startRow; i
package userinputdmo;
/*
try
catch
throw
throws
finally
*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class UserInputDmo {
public static void main(String[] args) {
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int x=0;
char t=49;
t+=t;
char c='A';
String k="Kumkum";
boolean flag=false;
do{
flag=false;
try{
System.out.println("Enter a number ");
x=Integer.parseInt(br.readLine());
if(!(x>=5 && x
21/02/2015
what will be the output of the following fragment-
int m=2;
int n=15;
for(int i=1;i
Private Sub btnCalculate_Click()
Dim amount As Long
Dim rate As Double
Dim term As Integer
Dim interest As Double
Dim total As Double
amount = Val(txtDeposit.Text)
rate = Val(txtRate.Text) / 100 / 12
term = Val(txtTerm.Text)
interest = amount * rate * term
txtInterest.Text = interest
txtTotal.Text = amount + interest
End Sub
Click here to claim your Sponsored Listing.
Contact the business
Telephone
Website
Address
Shibtala Road
Kolkata
700122
24/10/2024
06/06/2020