output: A- First code: import java.util; public elass Example ( public statie void main(String) args){ String name = "AI Ghamedi, Ahad, A"; System.out.printin"The full name is:"+name); System.out.print("initials with surname is: " Int len = name length(); name name.trim): String stri="; for (int i0, i len, i( char ch =name.charAti): f (ch l='{ stri = stri+ ch; Jelse { System.out.print(Character.toUpperCaselstri.charAt(0) +.": stri" String str2"; for (int j=0;< stri.length); +)( ifjaz o str2 = str2+ Character.toUpperCase(strl.charAt(0o): else str2 = str2+ Character.tolowerCase(strl.charat): System.out.printin(str2); B-Second code impert javautil.Scanner, public class Exercisel{ public statie void main(String) args)( Scanner input new Scanner(System.in): System.out.print("Input a degree in Fahernheit " double fahernheit = input.nextDouble(); double celsius = (|s (fahernheit - 32.0) /9.0): System.out.printlin(fahernheit +"degree Fahrenheit is equal to"+ celsius +" in Celsius"); // adding condition to check the value of temperature in Celsius # (celsius > 37) System.out.printin"The weather is hot"; alse System.out.printin("The weather is cold");
output: A- First code: import java.util; public elass Example ( public statie void main(String) args){ String name = "AI Ghamedi, Ahad, A"; System.out.printin"The full name is:"+name); System.out.print("initials with surname is: " Int len = name length(); name name.trim): String stri="; for (int i0, i len, i( char ch =name.charAti): f (ch l='{ stri = stri+ ch; Jelse { System.out.print(Character.toUpperCaselstri.charAt(0) +.": stri" String str2"; for (int j=0;< stri.length); +)( ifjaz o str2 = str2+ Character.toUpperCase(strl.charAt(0o): else str2 = str2+ Character.tolowerCase(strl.charat): System.out.printin(str2); B-Second code impert javautil.Scanner, public class Exercisel{ public statie void main(String) args)( Scanner input new Scanner(System.in): System.out.print("Input a degree in Fahernheit " double fahernheit = input.nextDouble(); double celsius = (|s (fahernheit - 32.0) /9.0): System.out.printlin(fahernheit +"degree Fahrenheit is equal to"+ celsius +" in Celsius"); // adding condition to check the value of temperature in Celsius # (celsius > 37) System.out.printin"The weather is hot"; alse System.out.printin("The weather is cold");
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
I need the answer as soon as possible
![9:32 PM A O
.all all
84
Home -
Question One: Rewrite the following oodes using NetBeans software, and take screenshots of the
output:
A- First code:
import java.util.;
public elass Example {
public static void main(String!) args) {
String name = "AI Ghamedi, Ahad, A";
System.out.printin("The full name is:"+name);
System.out.print("Initials with sumame is: ");
int len = name.length();
name name.trim();
String stri =";
for (int i0; i< len; it+)(
char ch = name.charAt(1);
if (eh l= '")(
stri = stri+ ch:
) else {
System.out.print(Character.toUpperCase(stri.charAt(0)) +". ");
stri = "";
String str2 =";
for (int j= 0, < stri.langth(); +)(
if (j == 0)
str2 = str2 + Character.toUpperCase(str1.charAt(0);
else
str2 = str2 + Character.tolowerCase(strl.charAt();
System.out.printin(str2);
B- Second code:
import java.util.Scanner;
public elass Exercisel{
publie statie void main(String[] args) (
Scanner input = new Scanner(System.in);
System.out.print("Input a degree in Fohernheit: ");
dauble fahernheit = input.nextDouble);
double celsius = (5 * (fahernheit - 32.0)) /9.0);
System.out.printlin(fahernheit +" degree Fahrenheit is equal to "+ celsius +" In Celslus");
// adding condition to check the value of temperature in Celsius
if (celsius > 37)
System.out.println("The weather is hot");
else
System.out.printin('The weather is cold");](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F9b562bdd-2ab8-4f0a-8ee1-fa7ceb2c7443%2F61eed6b0-e3eb-4f5f-8a6b-ec11f8c80fd0%2Fggjlruq_processed.jpeg&w=3840&q=75)
Transcribed Image Text:9:32 PM A O
.all all
84
Home -
Question One: Rewrite the following oodes using NetBeans software, and take screenshots of the
output:
A- First code:
import java.util.;
public elass Example {
public static void main(String!) args) {
String name = "AI Ghamedi, Ahad, A";
System.out.printin("The full name is:"+name);
System.out.print("Initials with sumame is: ");
int len = name.length();
name name.trim();
String stri =";
for (int i0; i< len; it+)(
char ch = name.charAt(1);
if (eh l= '")(
stri = stri+ ch:
) else {
System.out.print(Character.toUpperCase(stri.charAt(0)) +". ");
stri = "";
String str2 =";
for (int j= 0, < stri.langth(); +)(
if (j == 0)
str2 = str2 + Character.toUpperCase(str1.charAt(0);
else
str2 = str2 + Character.tolowerCase(strl.charAt();
System.out.printin(str2);
B- Second code:
import java.util.Scanner;
public elass Exercisel{
publie statie void main(String[] args) (
Scanner input = new Scanner(System.in);
System.out.print("Input a degree in Fohernheit: ");
dauble fahernheit = input.nextDouble);
double celsius = (5 * (fahernheit - 32.0)) /9.0);
System.out.printlin(fahernheit +" degree Fahrenheit is equal to "+ celsius +" In Celslus");
// adding condition to check the value of temperature in Celsius
if (celsius > 37)
System.out.println("The weather is hot");
else
System.out.printin('The weather is cold");
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps with 2 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education