100% Guaranteed Results


CSE 1001: Introduction to Computer Programming Solved
$ 20.99
Category:

Description

5/5 – (1 vote)

Programming Assignment-I (Elements of Programming)

1. Write a java program to display following messages.
Hello World!
Hello Again
I like typing this.
This is fun.
Yay! Printing.
I’d much rather you ‘not’. I “said” do not touch this.

2. Write a java program that displays your name and address on the screen as if it were a letter.
Your output should look something like that below.
+———————————————————+
| #### |
| #### |
| #### |
| |
| |
| Biswanath Dash |
| H.N:109, Baramunda |
| Bhubaneswar |
| |
+——————————————————————————————————-+

3. Write a java program to display your initials on the screen in block letters as shown. For example the name Tapan Kumar

TTTTTTTT K K
T K K
T K K
T K
T K K
T K K
T K K

4. Write a java program to print an equilateral triangle using star ‘ * ‘.

*
* *
* * *
* * * * * * * * *
5. Write a java program that stores your Regd. No and year of admission into two variables, and displays their values on the screen.

My Regd. No is 171123142 and I have taken admission in B. Tech. In 2017.

6. Let we have two values 113, 2.71828. Then, declare two different variables to hold the given values. Write the java program to display the values of these two variables on the screen, one per line.

This is room # 113 e is close to 2.71828

7. Write a java program to exchange the values of two variables of integer type A and B using third temporary variable C.

8. Write a java program to exchange the values of two variables of integer type A and B without using third temporary variable.

9. What do each of the following print?
a.System.out.println(2 + “bc”);
b.System.out.println(2 + 3 + “bc”);
c.System.out.println((2+3) + “bc”);
d.System.out.println(“bc” + (2+3));
e.System.out.println(“bc” + 2 + 3);

10. What do each of the following print?
a. System.out.println(‘b’);
b. System.out.println(‘b’ + ‘c’);
c. System.out.println((char) (‘a’ + 4));

11. Suppose that a variable a is declared as int a = 2147483647
(or equivalently, Integer.MAX_VALUE ). What do each of the following print?

a. System.out.println(a);
b. System.out.println(a+1);
c. System.out.println(2-a);
d. System.out.println(-2-a);
e. System.out.println(2*a);
f. System.out.println(4*a);

12. Suppose that a variable a is declared as double a = 3.14159. What do each of the following print?

a. System.out.println(a);
b. System.out.println(a+1);
c. System.out.println(8/(int) a);
d. System.out.println(8/a);
e. System.out.println((int) (8/a));

13. Assume a string variable ruler1 contains “1” initially i.e.
String ruler1=”1”
Write a java program to print the following output using string concatenation. (You can take extra string variables)

1
1 2 1
1 2 1 3 1 2 1
1 2 1 3 1 2 1 4 1 2 1 3 1 2 1

*****************

Reviews

There are no reviews yet.

Be the first to review “CSE 1001: Introduction to Computer Programming Solved”

Your email address will not be published. Required fields are marked *

Related products