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
4244 aaa 17-Oct-2019 08:08:22 PM
4243 pbin 15-Oct-2019 07:21:59 PM
4242 PMA 145 15-Oct-2019 10:30:00 AM
4241 Nts 13-Oct-2019 07:21:52 PM
4240 dgsdgf 10-Oct-2019 03:19:22 PM
4239 pubg 09-Oct-2019 04:16:01 PM
4238 stack drawer 09-Oct-2019 02:21:26 PM
4237 Su 08-Oct-2019 11:06:21 AM
4236 zebi 07-Oct-2019 03:01:21 PM
4235 zebi 07-Oct-2019 12:00:44 PM
4234 cxvzx 04-Oct-2019 07:58:06 PM
4233 ss 01-Oct-2019 07:02:44 PM
4232 theory 30-Sep-2019 09:16:01 PM
4231 verses 30-Sep-2019 09:15:13 PM
4230 Link 29-Sep-2019 12:05:48 PM
4229 drink 27-Sep-2019 04:31:39 PM
4228 FSOG 26-Sep-2019 05:45:39 PM
4227 Affaq 25-Sep-2019 11:22:46 PM
4226 picasso 24-Sep-2019 08:00:45 PM
4225 zain 24-Sep-2019 07:37:39 PM
4224 Autoincremen 23-Sep-2019 12:43:30 PM
4223 nafees4 23-Sep-2019 12:39:41 PM
4222 nafee3 23-Sep-2019 12:37:52 PM
4221 nafees2 23-Sep-2019 12:35:37 PM
4220 nafees1 23-Sep-2019 12:34:49 PM
4219 Osman 21-Sep-2019 01:48:16 PM
4218 nafees 21-Sep-2019 01:31:01 PM
4217 MMMM 20-Sep-2019 05:33:46 PM
4216 MMM 20-Sep-2019 03:51:02 PM
4215 newMMM 20-Sep-2019 03:34:35 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