SlideShare ist ein Scribd-Unternehmen logo
1 von 1
Downloaden Sie, um offline zu lesen
4.1 What is the line of code label A do? (2 marks)
4.2 What is happening on line B? (2 marks)
4.3 What is happening on line C? (2 marks)
4.4 What does line D do? (3 marks)
4.5 In line E, what is first and last called in programming? (1 marks)
4.6 Which line closes the main method, line F or I? (1 marks)
4.7 Why does line G have void? (3 marks)
4.8 What is the return type of the method in G? (1 marks)
4.9 What is happening in line H? (3 marks Consider the following code snippet and answer the
questions that follow using appropriate java programming constructs. Closely study the lines of
code numbered alphabetically. import java.util.Scanner; public class FormLetterWriter { public
static void main(String[] args) A { Scanner input = new Scanner(System.in); String first, last;
System.out.print("Enter first name >> "); first = input.nextLine(); System.out.print("Enter last
name >> "); last = input.nextLine(); displaySalutation(first); displayLetter();
displaySalutation(first, last); displayLetter(); } public static void displaySalutation(String
firstName) { System.out.printIn("Dear " + firstName + ","); } public static void
displaySalutation(String firstName, String lastName) { System.out.println("Dear " + firstName
+ " " + lastName +","); } public static void displayLetter() { System.out.println (" Thank you
for your recent order. ln"); } }

Weitere ähnliche Inhalte

Ähnlich wie 4.1 What is the line of code label A do (2 marks) 4.2 What is h.pdf

All based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdf
All based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdfAll based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdf
All based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdf
aroraenterprisesmbd
 
1 Midterm Preview Time allotted 50 minutes CS 11.docx
1  Midterm Preview Time allotted 50 minutes CS 11.docx1  Midterm Preview Time allotted 50 minutes CS 11.docx
1 Midterm Preview Time allotted 50 minutes CS 11.docx
honey725342
 
Question 1 1 pts Skip to question text.As part of a bank account.docx
Question 1 1 pts Skip to question text.As part of a bank account.docxQuestion 1 1 pts Skip to question text.As part of a bank account.docx
Question 1 1 pts Skip to question text.As part of a bank account.docx
amrit47
 
Fnt software solutions placement paper
Fnt software solutions placement paperFnt software solutions placement paper
Fnt software solutions placement paper
fntsofttech
 

Ähnlich wie 4.1 What is the line of code label A do (2 marks) 4.2 What is h.pdf (20)

Oop december 2018
Oop december 2018Oop december 2018
Oop december 2018
 
Lecture 1
Lecture 1Lecture 1
Lecture 1
 
T1
T1T1
T1
 
PYTHON QUIZ - 1.pptx
PYTHON QUIZ - 1.pptxPYTHON QUIZ - 1.pptx
PYTHON QUIZ - 1.pptx
 
Pcd201516
Pcd201516Pcd201516
Pcd201516
 
Oop sample ktu
Oop sample ktuOop sample ktu
Oop sample ktu
 
All based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdf
All based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdfAll based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdf
All based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdf
 
FSOFT - Test Java Exam
FSOFT - Test Java ExamFSOFT - Test Java Exam
FSOFT - Test Java Exam
 
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21
CBSE Class 12 Computer Science(083) Sample Question Paper 2020-21
 
1 Midterm Preview Time allotted 50 minutes CS 11.docx
1  Midterm Preview Time allotted 50 minutes CS 11.docx1  Midterm Preview Time allotted 50 minutes CS 11.docx
1 Midterm Preview Time allotted 50 minutes CS 11.docx
 
DAC CCAT GUESS PAPER Jun-Jul 2013
DAC CCAT GUESS PAPER Jun-Jul 2013 DAC CCAT GUESS PAPER Jun-Jul 2013
DAC CCAT GUESS PAPER Jun-Jul 2013
 
Multiple choice questions for Java io,files and inheritance
Multiple choice questions for Java io,files and inheritanceMultiple choice questions for Java io,files and inheritance
Multiple choice questions for Java io,files and inheritance
 
Test final jav_aaa
Test final jav_aaaTest final jav_aaa
Test final jav_aaa
 
Question 1 1 pts Skip to question text.As part of a bank account.docx
Question 1 1 pts Skip to question text.As part of a bank account.docxQuestion 1 1 pts Skip to question text.As part of a bank account.docx
Question 1 1 pts Skip to question text.As part of a bank account.docx
 
Fnt software solutions placement paper
Fnt software solutions placement paperFnt software solutions placement paper
Fnt software solutions placement paper
 
Java Questions and Answers
Java Questions and AnswersJava Questions and Answers
Java Questions and Answers
 
Programming fundamentals using c++ question paper 2014 tutorialsduniya
Programming fundamentals using c++  question paper 2014   tutorialsduniyaProgramming fundamentals using c++  question paper 2014   tutorialsduniya
Programming fundamentals using c++ question paper 2014 tutorialsduniya
 
Gate-Cs 1994
Gate-Cs 1994Gate-Cs 1994
Gate-Cs 1994
 
Adobe
AdobeAdobe
Adobe
 
Redo midterm
Redo midtermRedo midterm
Redo midterm
 

Mehr von rambagra74

5.1.a Contrast the functions of the DNA and protein components of ch.pdf
5.1.a Contrast the functions of the DNA and protein components of ch.pdf5.1.a Contrast the functions of the DNA and protein components of ch.pdf
5.1.a Contrast the functions of the DNA and protein components of ch.pdf
rambagra74
 
5. Cyanobacteria live mostly in aquatic habitats but they can also b.pdf
5. Cyanobacteria live mostly in aquatic habitats but they can also b.pdf5. Cyanobacteria live mostly in aquatic habitats but they can also b.pdf
5. Cyanobacteria live mostly in aquatic habitats but they can also b.pdf
rambagra74
 
5. Design and implement a method contains 2 for BinarySearchTree, fu.pdf
5. Design and implement a method contains 2 for BinarySearchTree, fu.pdf5. Design and implement a method contains 2 for BinarySearchTree, fu.pdf
5. Design and implement a method contains 2 for BinarySearchTree, fu.pdf
rambagra74
 
7. Lawn Spray Inc. desarrolla y produce equipos de pulverizaci�n.pdf
7. Lawn Spray Inc. desarrolla y produce equipos de pulverizaci�n.pdf7. Lawn Spray Inc. desarrolla y produce equipos de pulverizaci�n.pdf
7. Lawn Spray Inc. desarrolla y produce equipos de pulverizaci�n.pdf
rambagra74
 

Mehr von rambagra74 (20)

5.27 Company H has an insurance policy for which it pays an annual.pdf
5.27 Company H has an insurance policy for which it pays an annual.pdf5.27 Company H has an insurance policy for which it pays an annual.pdf
5.27 Company H has an insurance policy for which it pays an annual.pdf
 
5.1.a Contrast the functions of the DNA and protein components of ch.pdf
5.1.a Contrast the functions of the DNA and protein components of ch.pdf5.1.a Contrast the functions of the DNA and protein components of ch.pdf
5.1.a Contrast the functions of the DNA and protein components of ch.pdf
 
5.2 Par�s a Mosc�. En su programa de estudios de verano en el extr.pdf
5.2 Par�s a Mosc�. En su programa de estudios de verano en el extr.pdf5.2 Par�s a Mosc�. En su programa de estudios de verano en el extr.pdf
5.2 Par�s a Mosc�. En su programa de estudios de verano en el extr.pdf
 
5. Cyanobacteria live mostly in aquatic habitats but they can also b.pdf
5. Cyanobacteria live mostly in aquatic habitats but they can also b.pdf5. Cyanobacteria live mostly in aquatic habitats but they can also b.pdf
5. Cyanobacteria live mostly in aquatic habitats but they can also b.pdf
 
5. The Federal Reserves organization1) There are (5712) Feder.pdf
5. The Federal Reserves organization1) There are (5712)   Feder.pdf5. The Federal Reserves organization1) There are (5712)   Feder.pdf
5. The Federal Reserves organization1) There are (5712) Feder.pdf
 
5. Mrs. Toguchi wants to determine if politicians tend to have highe.pdf
5. Mrs. Toguchi wants to determine if politicians tend to have highe.pdf5. Mrs. Toguchi wants to determine if politicians tend to have highe.pdf
5. Mrs. Toguchi wants to determine if politicians tend to have highe.pdf
 
41. a and b 41. Introductory Statistics Course Withdrawals. A univer.pdf
41. a and b 41. Introductory Statistics Course Withdrawals. A univer.pdf41. a and b 41. Introductory Statistics Course Withdrawals. A univer.pdf
41. a and b 41. Introductory Statistics Course Withdrawals. A univer.pdf
 
41) �La justificaci�n legal como �nico criterio �tico es adecuada de.pdf
41) �La justificaci�n legal como �nico criterio �tico es adecuada de.pdf41) �La justificaci�n legal como �nico criterio �tico es adecuada de.pdf
41) �La justificaci�n legal como �nico criterio �tico es adecuada de.pdf
 
40. What is the common challenge in the world of financea. It gen.pdf
40. What is the common challenge in the world of financea. It gen.pdf40. What is the common challenge in the world of financea. It gen.pdf
40. What is the common challenge in the world of financea. It gen.pdf
 
4.a. Calculate Target�s current ratio as of January 29, 2022 (show cur.pdf
4.a. Calculate Target�s current ratio as of January 29, 2022 (show cur.pdf4.a. Calculate Target�s current ratio as of January 29, 2022 (show cur.pdf
4.a. Calculate Target�s current ratio as of January 29, 2022 (show cur.pdf
 
5. Earth HistoryPaleogeography - World. Check and double-click the .pdf
5. Earth HistoryPaleogeography - World. Check and double-click the .pdf5. Earth HistoryPaleogeography - World. Check and double-click the .pdf
5. Earth HistoryPaleogeography - World. Check and double-click the .pdf
 
5. Design and implement a method contains 2 for BinarySearchTree, fu.pdf
5. Design and implement a method contains 2 for BinarySearchTree, fu.pdf5. Design and implement a method contains 2 for BinarySearchTree, fu.pdf
5. Design and implement a method contains 2 for BinarySearchTree, fu.pdf
 
7. Para comprender mejor la prehistoria de la isla hawaiana de Lana.pdf
7. Para comprender mejor la prehistoria de la isla hawaiana de Lana.pdf7. Para comprender mejor la prehistoria de la isla hawaiana de Lana.pdf
7. Para comprender mejor la prehistoria de la isla hawaiana de Lana.pdf
 
7. Lawn Spray Inc. desarrolla y produce equipos de pulverizaci�n.pdf
7. Lawn Spray Inc. desarrolla y produce equipos de pulverizaci�n.pdf7. Lawn Spray Inc. desarrolla y produce equipos de pulverizaci�n.pdf
7. Lawn Spray Inc. desarrolla y produce equipos de pulverizaci�n.pdf
 
701 () � Kenneth_Laudon,_J... a a+ as Part One Ogriesions, Mrugemer.pdf
701 () �  Kenneth_Laudon,_J... a a+ as Part One Ogriesions, Mrugemer.pdf701 () �  Kenneth_Laudon,_J... a a+ as Part One Ogriesions, Mrugemer.pdf
701 () � Kenneth_Laudon,_J... a a+ as Part One Ogriesions, Mrugemer.pdf
 
71 of all students at a college still need to take another math class.pdf
71 of all students at a college still need to take another math class.pdf71 of all students at a college still need to take another math class.pdf
71 of all students at a college still need to take another math class.pdf
 
7.4.3 4.3 Consider a set of independent data observations x1,�.pdf
7.4.3 4.3 Consider a set of independent data observations x1,�.pdf7.4.3 4.3 Consider a set of independent data observations x1,�.pdf
7.4.3 4.3 Consider a set of independent data observations x1,�.pdf
 
7.16 LAB Smallest and largest numbers in a listWrite a program th.pdf
7.16 LAB Smallest and largest numbers in a listWrite a program th.pdf7.16 LAB Smallest and largest numbers in a listWrite a program th.pdf
7.16 LAB Smallest and largest numbers in a listWrite a program th.pdf
 
7. El balance general de Tucker Company reflejaba activos por $12,.pdf
7. El balance general de Tucker Company reflejaba activos por $12,.pdf7. El balance general de Tucker Company reflejaba activos por $12,.pdf
7. El balance general de Tucker Company reflejaba activos por $12,.pdf
 
4.3 Expresi�n positiva y cort�s Revise las siguientes declaracio.pdf
4.3 Expresi�n positiva y cort�s Revise las siguientes declaracio.pdf4.3 Expresi�n positiva y cort�s Revise las siguientes declaracio.pdf
4.3 Expresi�n positiva y cort�s Revise las siguientes declaracio.pdf
 

Kürzlich hochgeladen

Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
MateoGardella
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
MateoGardella
 

Kürzlich hochgeladen (20)

Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 

4.1 What is the line of code label A do (2 marks) 4.2 What is h.pdf

  • 1. 4.1 What is the line of code label A do? (2 marks) 4.2 What is happening on line B? (2 marks) 4.3 What is happening on line C? (2 marks) 4.4 What does line D do? (3 marks) 4.5 In line E, what is first and last called in programming? (1 marks) 4.6 Which line closes the main method, line F or I? (1 marks) 4.7 Why does line G have void? (3 marks) 4.8 What is the return type of the method in G? (1 marks) 4.9 What is happening in line H? (3 marks Consider the following code snippet and answer the questions that follow using appropriate java programming constructs. Closely study the lines of code numbered alphabetically. import java.util.Scanner; public class FormLetterWriter { public static void main(String[] args) A { Scanner input = new Scanner(System.in); String first, last; System.out.print("Enter first name >> "); first = input.nextLine(); System.out.print("Enter last name >> "); last = input.nextLine(); displaySalutation(first); displayLetter(); displaySalutation(first, last); displayLetter(); } public static void displaySalutation(String firstName) { System.out.printIn("Dear " + firstName + ","); } public static void displaySalutation(String firstName, String lastName) { System.out.println("Dear " + firstName + " " + lastName +","); } public static void displayLetter() { System.out.println (" Thank you for your recent order. ln"); } }