Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

Java Coding activities 2023 with complete solution

Rating
-
Sold
-
Pages
21
Grade
A+
Uploaded on
12-03-2023
Written in
2022/2023

Java Coding activities 2023 with complete solution T1L1 Coding activity 1 Write a program to print your name to the center of the output screen import .Scanner; import .Math; class Lesson_1_Activity_One { public static void main(String[] args) { Sln(" Hello"); Sln(" Carlos"); } } T1L1 Coding activity 2 Write a program to print your name to the center of the output screen on three different lines import .Scanner; import .Math; class Lesson_1_Activity_Two { public static void main(String[] args) { Sln(" Car "); Sln(" Los"); Sln(" Jurado"); } } T1L1 Coding activity 3 Write a program to output the following: ******** *java* ******** import .Scanner; import .Math; class Lesson_1_Activity_Three { public static void main(String[] args) { Sln("********"); Sln(" java "); Sln("********"); } } T1L2 Coding activity 1 Print the following shape: / / import .Scanner; import .Math; class Lesson_2_Activity_One { public static void main(String[] args) { Sln ("/"); Sln ("/"); } }

Show more Read less
Institution
Course

Content preview

Java Coding activities 2023 with complete solution
T1L1 Coding activity 1
Write a program to print your name to the center of the output screen
import java.util.Scanner;
import java.lang.Math;
class Lesson_1_Activity_One { public static void main(String[] args) {
System.out.println(" Hello");
System.out.println(" Carlos");
}
}
T1L1 Coding activity 2

Write a program to print your name to the center of the output screen on three different
lines
import java.util.Scanner;
import java.lang.Math;
class Lesson_1_Activity_Two { public static void main(String[] args) {
System.out.println(" Car ");
System.out.println(" Los");
System.out.println(" Jurado");
}
}
T1L1 Coding activity 3
Write a program to output the following:
********
*java*
********
import java.util.Scanner;
import java.lang.Math;
class Lesson_1_Activity_Three {
public static void main(String[] args) { System.out.println("********");
System.out.println(" java "); System.out.println("********");
}
}
T1L2 Coding activity 1
Print the following shape:
/\
\/
import java.util.Scanner;
import java.lang.Math;
class Lesson_2_Activity_One { public static void main(String[] args) {
System.out.println ("/\\");
System.out.println ("\\/");
}
}

,T1L2 Coding activity 2
Using only one "System.out.print" command, print the following quote. Make sure to
include the quote marks (") in your output.

"I do not fear computers. I fear the lack of them."
Isaac Asimov
import java.util.Scanner;
import java.lang.Math;
class Lesson_2_Activity_Two { public static void main(String[] args) {
System.out.println ("\"I do not fear computers. I fear the lack of them.\"\nIsaac Asimov");
}
}
T1L2 Coding activity 3
Write the code to output:

-
/\
||
\/
-
class Lesson_2_Activity_Three {
public static void main(String[] args) {
System.out.println (" _");
System.out.println (" / \\");
System.out.println ("| |");
System.out.println (" \\ _ /");
}
}
T1L3 Coding activity 1
Write the code to ask the user to enter their name and print the following message:
Hi ______, nice to see you.
import java.util.Scanner;
import java.lang.Math;
class Lesson_3_Activity_One { public static void main(String[] args) {
Scanner scan= new Scanner (System.in);
String n;
System.out.println ("What is your name?");
n = scan.nextLine();
System.out.println ("Hi " + n + ", nice to see you.");
}
}
T1L3 Coding activity 2
Write a program that asks the user for three names, then prints the names in reverse
order.

Sample Run:

, Please enter three names:
Zoey
Zeb
Zena
Zena
Zeb
Zoey
import java.util.Scanner;
import java.lang.Math;
class Lesson_3_Activity_Two {
public static void main(String[] args) {
Scanner scan= new Scanner (System.in);
String name1;
String name2;
String name3;
System.out.println ("Please enter three names:");
name1 =scan.nextLine();
name2 =scan.nextLine();
name3 =scan.nextLine();
System.out.println (name3+" "+name2+" "+name1);
}
}
T1L3 Coding activity 3
Write a program that will ask the user to enter an adjective and a name. Print the
following sentence, replacing the ______ with the words they entered.
My name is _____. I am _____.
import java.util.Scanner;
import java.lang.Math;
class Lesson_3_Activity_Three {
public static void main(String[] args) {
Scanner scan = new Scanner (System.in);
String name; String adjective;
System.out.println("Hi there. What is your name?");
name = scan.nextLine();
System.out.println("What adjective describes you?"); adjective = scan.nextLine();
System.out.println("My name is " + name + ". I am " + adjective + ".");
}
}
T1L4 Coding activity 1
Input two doubles and print them backward on the screen.
So if the user enters:
1.3 6.8
It should output:
6.8 1.3
import java.util.Scanner;
import java.lang.Math;

Written for

Course

Document information

Uploaded on
March 12, 2023
Number of pages
21
Written in
2022/2023
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$11.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
LECTMAGGY Chamberlain College Of Nursing
Follow You need to be logged in order to follow users or courses
Sold
146
Member since
3 year
Number of followers
121
Documents
6311
Last sold
1 week ago
LECTMAGGY

Here, you will find everything you need in NURSING EXAMS AND TESTBANKS.Contact us, to fetch it for you in minutes if we do not have it in this shop.BUY WITHOUT DOUBT!!!!Always leave a review after purchasing any document so as to make sure our customers are 100% satisfied.

3.3

28 reviews

5
8
4
3
3
11
2
0
1
6

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions