×
FREE ASSISTANCE FOR THE INQUISITIVE PEOPLE
Tutorial Topics
X
softetechnologies
Write a program to Blinking a Text using Applet.
Programme to Compute Telegram Charge - Java
3396    Arnab De    16/06/2018

Programme to Compute Telegram Charge.

Write a programme to compute the telegram charges as follows:
Words Charges
Up to 15 words                      Rs.5/-
More than 15 words              Rs.1/word
Accept a string as telegram message and the character ('n' for normal and 'e' for express) to calculate the telegram charge.

softetechnologies
import java.util.*;
public class Telegram
{
    public static void main(String []args)
    {
        Scanner sc=new Scanner(System.in);
        System.out.print("Enter A String : ");
        String str=sc.nextLine();
        String []words=str.split(" ");
        int len=words.length;
        double amt=5.0;
        if(len>15)
        {
            amt += (len-15);
        }
        System.out.print(" Total Charge : " + amt);
    }
}
softetechnologies

Enter A String : On the Insert tab, the galleries include items that are designed.
Total Charge : 5.0
Enter A String :  On the Insert tab, the galleries include items that are designed to coordinate with the overall look of your document.
Total Charge : 20.0

Write a program to Blinking a Text using Applet.
softetechnologies
Author Details
Arnab De
I have over 16 years of experience working as an IT professional, ranging from teaching at my own institute to being a computer faculty at different leading institute across Kolkata. I also work as a web developer and designer, having worked for renowned companies and brand. Through tutorialathome, I wish to share my years of knowledge with the readers.
Enter New Comment
Comment History
No Comment Found Yet.
Rabindranath Tagore
Every child comes with the message that God is not yet discouraged of man.
Rabindranath Tagore
4385
40.91
Today So Far
Total View (Lakh)
softetechnologies
01/01/2018     34530
26/05/2018     32724
28/06/2017     31338
02/08/2017     29642
25/06/2018     27478
15/05/2017     24907
01/08/2017     24107
06/07/2017     23632
21/04/2018     19454
14/07/2017     19143
softetechnologies