• Tidak ada hasil yang ditemukan

Multimedia Technology CPIT 380 Quiz

N/A
N/A
Protected

Academic year: 2025

Membagikan "Multimedia Technology CPIT 380 Quiz"

Copied!
4
0
0

Teks penuh

(1)

import java.util.Scanner;

public class FinalExamB{

public static void main(String []args){

Scanner s=new Scanner(System.in);

System.out.println("Choose one of the following\n1.Picture Manipulating"

+"\n2.Sound Manipulation\n3.Manipulating Texts");

int choice=s.nextInt();

//for the first question if(choice==1){

//ask the user to pick a picture file.

System.out.println("Choose one of the following\n1.Dispaly the width and the height if both values are more than 500"

+", otherwise you do not display it."

+"\n2.Explore the picture if the file name ends with .jpg.\n3.Decrease the red to .75 of the picture length"

+"\n4.Negate the picture\n5.mirror the picture vertically and decrease"

+" the green color of the right side by .3");

int pic_choices=s.nextInt();

if(pic_choices==1){

//Dispaly the width and the height if both values are more than 500 otherwise you do not display it.

} else

if(pic_choices==2){

//Explore the picture if the file name ends with .jpg.

(2)

Multimedia Technology CPIT 380 Quiz

}

else if(pic_choices==3){

//Decrease the red to .75 of the picture length

}

else if(pic_choices==4){

//4.Negate the picture

}

else if(pic_choices==5){

//5.mirror the picture vertically and decrease the green color of the right side by .3

} }

//for the second question else if (choice==2){

//ask the user to pick a sound file.

System.out.println("Choose one of the following\n1.Display the value of the first 70 samples of the sound"

+"\n2.Set the last sample value of the sound to 200\n3.Decrease the volume of the sound by .9 "

+"\n4.Clip the sound from the first index to the quarter length..\n"+

"5.Increase the volume of the first half of the sound by 5");

int sound_choices=s.nextInt();

if(sound_choices==1){

//Display the value of the first 70 samples of the sound }

(3)

Multimedia Technology CPIT 380 Quiz

else

if(sound_choices==2){

//Set the last sample value of the sound to 200

}

else if(sound_choices==3){

//Decrease the volume of the sound by .9

}

else if(sound_choices==4){

//Clip the sound from the first index to the quarter length.

}

else if(sound_choices==5){

//Increase the volume of the first half of the sound by 5

} }

//for the third question else if(choice==3){

//Save your ID in a string and do the tasks

//3.1. Substring your ID from 2 to the end of the ID and print it.

//3.2. Check if your ID ends with 0 or 1 , if so print out ("Yes it ends with 0 or 1") //, otherwise ("It doesn’t end with 0 nor 1").

(4)

Multimedia Technology CPIT 380 Quiz

//3.3. Convert the previous message to Upper cases using a proper method and print it again

}}}

Referensi

Dokumen terkait

public static void main(String[] args) { System.out.println(“Welcome to Java!”); } } Method Block Class Block..

l Consider the following class stored in a file called MyApplication.java: public class MyApplication { public static void mainString[] args { MyProgram p = new MyProgram;

Solution In one of your classes, ensure you implement astaticmethod named Mainwith one of the following signatures: public static void Main; public static void Mainstring[] args;

import javax.swing.*; import java.awt.event.*; public class SimpleGui1B implements ActionListener { JButton button; public static void mainString[] args { SimpleGui1B = new SimpleGui1B;

Java Application Menampilkan Tulisan //Welcome1.java Public class Welcome1 { //main method memulai eksekusi aplikasi java public static void main String args[] {

Java Application Aplikasi: Menampilkan Tulisan //Welcome1.java Public class Welcome1 { //main method memulai eksekusi aplikasi java public static void main String args[] {

Example import javax.swing.*; import java.awt.*; public class OnePrgLine extends JPanel{ public static void mainString[] args { int x1,y1,xn,yn; JFrame frame = new

import java.util.Scanner; public class AccountTest { // main method begins execution of Java application public static void main String args[] { Account account1 = new Account