Copy and Paste  -   An Application to Copy/Paste Text  

 
S.No 4218 Name nafees Date/Time 21-Sep-2019 01:31:01 PM

Copy text from below
package assignment.pkg1.group4;
import java.util.Scanner;

public class Assignment1Group4 {

public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("----------------Assignment#1--------------------");
System.out.println("------------------GROUP 4-----------------------");
System.out.println("------------------------------------------------");
int n = 1;
do {
System.out.println("program to provide values of complex functions like\n"
+ "2^x & x^2 & x^y & y^x and factorial of a number");
System.out.println("1.Enter base value");
System.out.println("2.Enter exponent value");
System.out.println("3.Enter x & y for x^y");
System.out.println("4.Enter value to find factorial");
System.out.println("Enter your choice :");
int choice = in.nextInt();
switch (choice) {
case 1:
System.out.println("Enter value of x for 2^x ");
int x = in.nextInt();
int res1 = 1;
for (int i = 1; i <= x; i++) {

res1 = res1 * 2;
}
System.out.println("Result =" + res1);
break;
case 2:
System.out.println("Enter value of x for x^2");
int y = in.nextInt();
int res2 = y * y;

System.out.println("Result=" + res2);
break;
case 3:
System.out.println("Enter value of x...");
int first = in.nextInt();
System.out.println("Enetr value of y....");
int second = in.nextInt();
int res3 = 1;
for (int i = 0; i < second; i++) {

res3 = res3 * first;
}
System.out.println("Result=" + res3);
break;
case 4:
System.out.println("Enter value to find factorial");
int res4 = 1;
int val = in.nextInt();


for (int i = 1; i <=val; i++) {
res4 = res4 * i;

}
System.out.println("res4= "+res4);

break;
default:
System.out.println("Defaulted value");

}
System.out.println("enter 1 to repeat/ enter 0 to stop: ");
n = in.nextInt();

} while (n != 0);
}
}




comments powered by Disqus
NEW ENTRIES
S.No Name Entry Time/Date
4385 aa 05-Aug-2020 12:08:51 AM
4384 nvcx 03-Aug-2020 06:46:25 PM
4383 lll 03-Aug-2020 06:45:54 PM
4382 Abd 07-Jul-2020 01:39:30 AM
4381 Dds 22-Jun-2020 11:52:09 AM
4380 Shahbaz bin 16-Jun-2020 08:33:52 AM
4379 Shahbaz bin 14-Jun-2020 09:43:02 AM
4378 meet 31-May-2020 02:01:24 PM
4377 Bills 20-May-2020 04:26:40 PM
4376 xk 18-May-2020 12:17:09 AM
4375 jamshed 12-May-2020 04:32:56 PM
4374 Saad 07-May-2020 11:58:32 PM
4373 Furqan 06-May-2020 06:13:59 PM
4372 Cyanide 06-May-2020 01:41:09 PM
4371 setprecison 03-May-2020 05:50:29 PM
4370 globalloacal 03-May-2020 05:50:07 PM
4369 zain 03-May-2020 05:49:14 PM
4368 sfr 27-Apr-2020 01:07:48 AM
4367 za 26-Apr-2020 02:17:14 PM
4366 shahbaz 20-Apr-2020 03:05:16 PM
4365 resoultion 13-Apr-2020 02:50:16 AM
4364 Mac command 13-Apr-2020 02:47:04 AM
4363 test 05-Apr-2020 01:29:07 AM
4362 a 24-Mar-2020 11:44:12 AM
4361 Checkout 23-Mar-2020 03:15:04 PM
4360 Maleeha 14-Mar-2020 09:45:42 AM
4359 OOP-CIT 11-Mar-2020 04:51:40 PM
4358 mansoor 10-Mar-2020 03:59:44 PM
4355 cc 02-Mar-2020 06:52:22 PM
4354 B 02-Mar-2020 06:04:56 PM

1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 [Next] [Last]
 
web counter
web counter


To report any error messages or bugs, or other issues, please send email at: info@pakproject.com