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
icon
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");
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
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education