Input name of a subscriber, mobile number, previous reading and present reading.
Find number of calls, phone charge and print a bill. The charge is Rs. 0.80 per call.
import java.util.*;
public class Mobile
{
public static void main()
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter name, mobile number, previous and present reading");
Input previous reading and present reading. Find number of calls, mobile charge and print a bill.
If the calls are above 50 then the charge is Rs. 0.80 per unit. (Otherwise no charge). Use simple if.
import java.util.*;
public class Mobile
{
public static void main()
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter previous and present reading");
Input previous reading and present reading. Find the mobile charge and print a bill.
For the first 50 calls the charge is Rs. 0.0 per unit. For remaining calls Rs. 0.80 per unit.
import java.util.*;
public class Mobile
{
public static void main()
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter previous and present reading");
Input previous reading and present reading. Find mobile charge and print a bill.
For the first 50 calls the charge is Rs. 0.0 per unit. Next 50 calls Rs. 0.80 per unit.
For remaining calls Rs. 1.20 per unit.
import java.util.*;
public class Mobile
{
public static void main()
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter previous and present reading");
Input previous reading and present reading. Find mobile charge and print a bill.
For the first 50 calls charge is Rs. 0.80 per call.
For remaining calls Rs. 1.00 per call.
For BSNL employees 60% reduction.
import java.util.*;
public class Mobile
{
public static void main()
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter previous and present reading");
Input n subscribers’ names and number of calls. Find mobile charge and print a bill
for each subscriber. Also find total collection. For first 50 calls charge is Rs. 0.80 per unit.
Remaining calls Rs. 1.00 per unit.
import java.util.*;
public class Mobile
{
public static void main()
{
Scanner sc=new Scanner(System.in);
System.out.print("Enter number of subscribers: ");
int n=sc.nextInt();
double tot=0.0;
for(int i=1;i<=n;i++)
{
System.out.println("Enter name and number of calls");