Search This Blog

UI/UX Design | Web Development | Mobile Application Development

Whether you need UI/ UX design, web development services, or mobile app development services, Qaabil Digitals will be more than happy to help you. We work with top software developers, designers, and project managers. We tailor our services to suit your exact needs. We closely look at your company, listen to your story, and bring about the best ideas and solutions that can help you drive solid results. We don’t just produce work that works. We produce work that matters. Get a quote now Or Talk to us

Saturday, 5 November 2011

Java program to create an ARRAY of 5 STRINGS. The program finds and displays the total number of vowels (both uppercase and lowercase) in all five strings by (Adler Lawn Service, LLC)


import java.util.*;
class vowels
{
public static void main (String args[])
{
Scanner in = new Scanner (System.in);
String n="",n1,n2,n3,n4,n5;
char c;
int r=1;

System.out.print ("\n\t Enter first name of first person = ");
n1 = in.nextLine();
System.out.print ("\n\t Enter first name of second person = ");
n2 = in.nextLine();
System.out.print ("\n\t Enter first name of third person = ");
n3 = in.nextLine();
System.out.print ("\n\t Enter first name of fourth person = ");
n4 = in.nextLine();
System.out.print ("\n\t Enter first name of fifth person = ");
n5 = in.nextLine();

while (r<6)
{
if (r==1)
{
n=n1;
System.out.print ("\n\n\t Vowels in first person's name = ");
}
else if (r==2)
{
n=n2;
System.out.print ("\n\n\t Vowels in second person's name = ");
}
else if (r==3)
{
n=n3;
System.out.print ("\n\n\t Vowels in third person's name = ");
}
else if (r==4)
{
n=n4;
System.out.print ("\n\n\t Vowels in fourth person's name = ");
}
else if (r==5)
{
n=n5;
System.out.print ("\n\n\t Vowels in fifth person's name = ");
}
else
System.out.println ();

for (int i=0;i<n.length();++i)
{
c=n.charAt(i);
switch (c)
{
case 'A':
case 'a':
System.out.print (" "+c);
break;
case 'E':
case 'e':
System.out.print (" "+c);
break;
case 'I':
case 'i':
System.out.print (" "+c);
break;
case 'O':
case 'o':
System.out.print (" "+c);
break;
case 'U':
case 'u':
System.out.print (" "+c);
break;
default:
System.out.print ("");
}
}

++r;
}

}
}

Wednesday, 26 October 2011

A video rental shop maintains the inventory of videotapes that are being sold in the shop. Whenever a customer wants to rent a videotape, the sales person can check through the list to find out the availability of that particular videotape. If it is not available, then certain message will be displayed. If it is available, then the system displays the details. If the customer confirms his/her choice, the system displays the price and the due date for returning the videotape by (noor diana fauzi)

import java.util.*;
class moviesforrent
{
public static void main (String args[])
{
Scanner in = new Scanner (System.in);
String mname;
System.out.print ("\n\t Enter the movie name = ");
mname=in.nextLine();
movies ob = new movies();
ob.pricendetail(mname);
}
}

class movies
{
String ma[] = new String [4];
String mc[] = new String [4];
//price per week=RM10.
movies()
{
ma[0]="fast&furious";
ma[1]="pearl harbor";
ma[2]="death note";
ma[3]="ratatouille";

mc[0]="Josh Hartnett";
mc[1]="Ben Affleck";
mc[2]="Michael Bays";
mc[3]="Jerry Bruckheimer";
}

void pricendetail(String mname)
{
int i=0,j=0;
while (i<4)
{
if (mname.equals(ma[i]))
{
System.out.println ("\n\t Movie: "+mname+" \n\t Main character: "+mc[i]+"\n\t Price per week = RM 10.00");
j=1;
break;
}
++i;
}
if (j==0)
System.out.println ("\n\t "+mname+" is not available.");
}

}

Tuesday, 25 October 2011

Java program that joins 3 strings to show the quote, the person who said that and dates he/she lived by(Adler Lawn Service, LLC)

import java.util.*;

class joinstring
{
public static void main (String args[])
{
Scanner in= new Scanner (System.in);
String quote,name,date;

System.out.print ("\n\t Enter the quote = ");
quote=in.nextLine();
System.out.print ("\n\t Enter name of the person who said this = ");
name=in.nextLine();
System.out.print ("\n\t Enter the dates that person lived \n\t (i.e. 14 September 1925 - 25 January 1995 ) = ");
date=in.nextLine();

System.out.println ("\n\n\n\t ''"+quote+"''\n\t "+name+"\n\t ("+date+")");

}
}

Wednesday, 19 October 2011

Java program to find sum, average and modulus by 3, of three numbers by(aol.com)

import java.util.*;
class average
{
public static void main (String args[])
{
Scanner in = new Scanner (System.in);
double a,b,c,sum=0;
double mod,avg;
System.out.print ("\n\t Enter first number = ");
a=in.nextDouble();
System.out.print ("\n\t Enter second number = ");
b=in.nextDouble();
System.out.print ("\n\t Enter third number = ");
c=in.nextDouble();
sum=a+b+c;
avg=sum/3;
mod=sum%3;




System.out.println ("\n\t Sum of the numbers = "+sum);
System.out.println ("\n\t Average of the numbers = "+avg);
System.out.println ("\n\t Modulus of the sum of numbers by 3 = "+mod);
}
}

Share