Java

Java program to have random number(s) within a specified limit

Code package com.physicsinfo; import java.util.Scanner; public class Main { public static void main(String args[]){ System.out.print(“Enter the highest integer within which you want the random number: “); Scanner sc = new Scanner(System.in); int highest = sc.nextInt(); System.out.print(“How many random numbers do you want to have printed: “); int count = sc.nextInt(); double rand; System.out.println(“Here is/are your …

Java program to have random number(s) within a specified limit Read More »

Banking system software code in Java

package com.physicsinfo; import javax.swing.*; import java.util.Scanner; class account{ int amount, acc_no; String name; void display(int acct_no, String name, int bal){ System.out.println(acct_no+” “+name+” “+bal); } void deposit(int amnt){ amount = amount +amnt; System.out.println(“Deposit successful. Your new balance is: “+amount); } void withdraw(int wdr){ if (wdr>amount){ System.out.println(“Insufficient balance.”); } else { amount = amount – wdr; System.out.println(“Withdraw …

Banking system software code in Java Read More »