Module 3 - Computer-Programming-1
Module 3 - Computer-Programming-1
2CC10
Computer
Programming
1
Name:
Course: Bachelor of Science in Information Technology
Using switch case, create a program that determines whether a user inputted character is a
vowel or consonant.
char ch = 'a';
switch (ch) {
case 'a':
case 'e':
case 'i':
case 'o':
case 'u':
System.out.println(ch + " is vowel");
break;
default:
System.out.println(ch + " is consonant");
}
}
}
Write a program that will print a diamond shape asterisk (*) on screen.
public class DiamondAsterisk {
public static void main(String[] args) {
int i,j,k;
for(i=1; i<=5; i++)
{
for(j=5; j>i; j--)
{
System.out.print(" ");
}
for(k=1; k<=(2*i-1);k++)
{
System.out.print("*");
}
System.out.print("\n");
}
You are working as Senior Programmer at McBee Food Corp and you were asked to write
an ordering program. The program accepts a user’s oder. The program will compute the
total cost of the order including the 12% VAT for non senior citizen/PWD then display
the receipt. The program ends when there’s no more orders to be made. Illustrate the flow
of your program using flowchart.