SlideShare a Scribd company logo
1 of 4
Download to read offline
In java this manages a list of flower names
public class FlowerList {
private static final int LISTLEN = 6;
private String[] list = new String[LISTLEN];
public FlowerList() {
list[0] = "daisy";
list[1] = "rose";
list[2] = "lily";
list[3] = "dandelion";
list[4] = "thistle";
list[5] = "sunflower";
}
public String getFlowerAtPosition(int pos) {
}
public String listAllTheFlowers() {
}
public String listFirstCharacters() {
}
public String listBackwardsCapitalized() {
}
}
This class has
one instance variable which is an array of strings named list. It also has a
constructor which initializes the values in the list.
1. Fill in the method
public String getFlowerAtPosition(int pos)
that returns the String at a given position. If the position is out of bounds, it should
return an empty strings.
2. Fill in the method
public String listAllTheFlowers()
which should return a string consisting of all of the flower names concatenated
together.
3. Fill in the method
public String listFirstCharacters()
Which should return the string consisting of just the first characters of each flower
name, separated by newlines.
4. Fill in the method
public String listBackwardsCapitalized()
This should return the string consisting of the flower names in reverse order and in
all capital letters.
In java this manages a list of flower names
public class FlowerList {
private static final int LISTLEN = 6;
private String[] list = new String[LISTLEN];
public FlowerList() {
list[0] = "daisy";
list[1] = "rose";
list[2] = "lily";
list[3] = "dandelion";
list[4] = "thistle";
list[5] = "sunflower";
}
public String getFlowerAtPosition(int pos) {
}
public String listAllTheFlowers() {
}
public String listFirstCharacters() {
}
public String listBackwardsCapitalized() {
}
}
This class has
one instance variable which is an array of strings named list. It also has a
constructor which initializes the values in the list.
1. Fill in the method
public String getFlowerAtPosition(int pos)
that returns the String at a given position. If the position is out of bounds, it should
return an empty strings.
2. Fill in the method
public String listAllTheFlowers()
which should return a string consisting of all of the flower names concatenated
together.
3. Fill in the method
public String listFirstCharacters()
Which should return the string consisting of just the first characters of each flower
name, separated by newlines.
4. Fill in the method
public String listBackwardsCapitalized()
This should return the string consisting of the flower names in reverse order and in
all capital letters.

More Related Content

Similar to In java this manages a list of flower names public class Flo.pdf

Write a java class LIST that outputsmainpublic class Ass.pdf
Write a java class LIST that outputsmainpublic class Ass.pdfWrite a java class LIST that outputsmainpublic class Ass.pdf
Write a java class LIST that outputsmainpublic class Ass.pdf
ebrahimbadushata00
 
public class EllipsoidList { private String list- private Array.pdf
public class EllipsoidList {     private String list-    private Array.pdfpublic class EllipsoidList {     private String list-    private Array.pdf
public class EllipsoidList { private String list- private Array.pdf
3rdeyesolutions
 
ReverseList.javaimport java.util.ArrayList;public class Rever.pdf
 ReverseList.javaimport java.util.ArrayList;public class Rever.pdf ReverseList.javaimport java.util.ArrayList;public class Rever.pdf
ReverseList.javaimport java.util.ArrayList;public class Rever.pdf
aryan9007
 
Java AssignmentUsing the ListNode.java file below Write method.pdf
Java AssignmentUsing the ListNode.java file below Write method.pdfJava AssignmentUsing the ListNode.java file below Write method.pdf
Java AssignmentUsing the ListNode.java file below Write method.pdf
ambersushil
 
Turn the linked list implementation into a circular list Ha.pdf
Turn the linked list implementation into a circular list Ha.pdfTurn the linked list implementation into a circular list Ha.pdf
Turn the linked list implementation into a circular list Ha.pdf
ajayadinathcomputers
 
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdfLabprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
freddysarabia1
 
   public static List tokenify(String string) come back list;.pdf
    public static List tokenify(String string) come back list;.pdf    public static List tokenify(String string) come back list;.pdf
   public static List tokenify(String string) come back list;.pdf
angelnxcom
 
Step 1 The Pair Class Many times in writing software we come across p.pdf
Step 1 The Pair Class Many times in writing software we come across p.pdfStep 1 The Pair Class Many times in writing software we come across p.pdf
Step 1 The Pair Class Many times in writing software we come across p.pdf
formaxekochi
 
Please create the appropriate JUnit test cases to thoroughly.pdf
Please create the appropriate JUnit test cases to thoroughly.pdfPlease create the appropriate JUnit test cases to thoroughly.pdf
Please create the appropriate JUnit test cases to thoroughly.pdf
kitty811
 
2.(Sorted list array implementation)This sorted list ADT discussed .pdf
2.(Sorted list array implementation)This sorted list ADT discussed .pdf2.(Sorted list array implementation)This sorted list ADT discussed .pdf
2.(Sorted list array implementation)This sorted list ADT discussed .pdf
arshin9
 
package singlylinkedlist; public class Node { public String valu.pdf
package singlylinkedlist; public class Node { public String valu.pdfpackage singlylinkedlist; public class Node { public String valu.pdf
package singlylinkedlist; public class Node { public String valu.pdf
amazing2001
 
import java-util-ArrayList- import java-util-Collections- import java-.pdf
import java-util-ArrayList- import java-util-Collections- import java-.pdfimport java-util-ArrayList- import java-util-Collections- import java-.pdf
import java-util-ArrayList- import java-util-Collections- import java-.pdf
adhityalapcare
 

Similar to In java this manages a list of flower names public class Flo.pdf (16)

Write a java class LIST that outputsmainpublic class Ass.pdf
Write a java class LIST that outputsmainpublic class Ass.pdfWrite a java class LIST that outputsmainpublic class Ass.pdf
Write a java class LIST that outputsmainpublic class Ass.pdf
 
public class EllipsoidList { private String list- private Array.pdf
public class EllipsoidList {     private String list-    private Array.pdfpublic class EllipsoidList {     private String list-    private Array.pdf
public class EllipsoidList { private String list- private Array.pdf
 
ReverseList.javaimport java.util.ArrayList;public class Rever.pdf
 ReverseList.javaimport java.util.ArrayList;public class Rever.pdf ReverseList.javaimport java.util.ArrayList;public class Rever.pdf
ReverseList.javaimport java.util.ArrayList;public class Rever.pdf
 
Java AssignmentUsing the ListNode.java file below Write method.pdf
Java AssignmentUsing the ListNode.java file below Write method.pdfJava AssignmentUsing the ListNode.java file below Write method.pdf
Java AssignmentUsing the ListNode.java file below Write method.pdf
 
Turn the linked list implementation into a circular list Ha.pdf
Turn the linked list implementation into a circular list Ha.pdfTurn the linked list implementation into a circular list Ha.pdf
Turn the linked list implementation into a circular list Ha.pdf
 
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdfLabprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
Labprogram.javaLinkedList.javaimport java.util.NoSuchElementEx.pdf
 
   public static List tokenify(String string) come back list;.pdf
    public static List tokenify(String string) come back list;.pdf    public static List tokenify(String string) come back list;.pdf
   public static List tokenify(String string) come back list;.pdf
 
Step 1 The Pair Class Many times in writing software we come across p.pdf
Step 1 The Pair Class Many times in writing software we come across p.pdfStep 1 The Pair Class Many times in writing software we come across p.pdf
Step 1 The Pair Class Many times in writing software we come across p.pdf
 
Please create the appropriate JUnit test cases to thoroughly.pdf
Please create the appropriate JUnit test cases to thoroughly.pdfPlease create the appropriate JUnit test cases to thoroughly.pdf
Please create the appropriate JUnit test cases to thoroughly.pdf
 
2.(Sorted list array implementation)This sorted list ADT discussed .pdf
2.(Sorted list array implementation)This sorted list ADT discussed .pdf2.(Sorted list array implementation)This sorted list ADT discussed .pdf
2.(Sorted list array implementation)This sorted list ADT discussed .pdf
 
Kotlin 101 Workshop
Kotlin 101 WorkshopKotlin 101 Workshop
Kotlin 101 Workshop
 
package singlylinkedlist; public class Node { public String valu.pdf
package singlylinkedlist; public class Node { public String valu.pdfpackage singlylinkedlist; public class Node { public String valu.pdf
package singlylinkedlist; public class Node { public String valu.pdf
 
Implement a singly linked list as a functional data structure in Ko.pdf
 Implement a singly linked list as a functional data structure in Ko.pdf Implement a singly linked list as a functional data structure in Ko.pdf
Implement a singly linked list as a functional data structure in Ko.pdf
 
Implement the additional 5 methods as indicated in the LinkedList fi.pdf
Implement the additional 5 methods as indicated in the LinkedList fi.pdfImplement the additional 5 methods as indicated in the LinkedList fi.pdf
Implement the additional 5 methods as indicated in the LinkedList fi.pdf
 
Scala - THE language for Big Data
Scala - THE language for Big DataScala - THE language for Big Data
Scala - THE language for Big Data
 
import java-util-ArrayList- import java-util-Collections- import java-.pdf
import java-util-ArrayList- import java-util-Collections- import java-.pdfimport java-util-ArrayList- import java-util-Collections- import java-.pdf
import java-util-ArrayList- import java-util-Collections- import java-.pdf
 

More from adithiyaatextile

In the pedigree below persons with a hatched marking are af.pdf
In the pedigree below persons with a hatched marking are af.pdfIn the pedigree below persons with a hatched marking are af.pdf
In the pedigree below persons with a hatched marking are af.pdf
adithiyaatextile
 
In Python I am struggling with getting the functions to wor.pdf
In Python I am struggling with getting the functions to wor.pdfIn Python I am struggling with getting the functions to wor.pdf
In Python I am struggling with getting the functions to wor.pdf
adithiyaatextile
 

More from adithiyaatextile (20)

In the pedigree below persons with a hatched marking are af.pdf
In the pedigree below persons with a hatched marking are af.pdfIn the pedigree below persons with a hatched marking are af.pdf
In the pedigree below persons with a hatched marking are af.pdf
 
In terms of race and ethnicity a People who are White in ra.pdf
In terms of race and ethnicity a People who are White in ra.pdfIn terms of race and ethnicity a People who are White in ra.pdf
In terms of race and ethnicity a People who are White in ra.pdf
 
In the NPR Hidden Brain Podcast we listened to Professor Ban.pdf
In the NPR Hidden Brain Podcast we listened to Professor Ban.pdfIn the NPR Hidden Brain Podcast we listened to Professor Ban.pdf
In the NPR Hidden Brain Podcast we listened to Professor Ban.pdf
 
In the following exercise we use data from HollywoodMovies.pdf
In the following exercise we use data from HollywoodMovies.pdfIn the following exercise we use data from HollywoodMovies.pdf
In the following exercise we use data from HollywoodMovies.pdf
 
In the movie Austin Powers International Man of Mystery a.pdf
In the movie Austin Powers International Man of Mystery a.pdfIn the movie Austin Powers International Man of Mystery a.pdf
In the movie Austin Powers International Man of Mystery a.pdf
 
In the past Ethernets predominantly used a medium access co.pdf
In the past Ethernets predominantly used a medium access co.pdfIn the past Ethernets predominantly used a medium access co.pdf
In the past Ethernets predominantly used a medium access co.pdf
 
In the initial Cournot oligopoly equilibrium both firms hav.pdf
In the initial Cournot oligopoly equilibrium both firms hav.pdfIn the initial Cournot oligopoly equilibrium both firms hav.pdf
In the initial Cournot oligopoly equilibrium both firms hav.pdf
 
In the fruit fly Drosophila a spineless no wing bristles.pdf
In the fruit fly Drosophila a spineless no wing bristles.pdfIn the fruit fly Drosophila a spineless no wing bristles.pdf
In the fruit fly Drosophila a spineless no wing bristles.pdf
 
In the implementation of the ordinary Queue if the dequeue .pdf
In the implementation of the ordinary Queue if the dequeue .pdfIn the implementation of the ordinary Queue if the dequeue .pdf
In the implementation of the ordinary Queue if the dequeue .pdf
 
In the formula IPAT which of the following would be repres.pdf
In the formula IPAT which of the following would be repres.pdfIn the formula IPAT which of the following would be repres.pdf
In the formula IPAT which of the following would be repres.pdf
 
In the game Sorry players draw a card and move around the.pdf
In the game Sorry players draw a card and move around the.pdfIn the game Sorry players draw a card and move around the.pdf
In the game Sorry players draw a card and move around the.pdf
 
In the following web login system Assuming that the applica.pdf
In the following web login system Assuming that the applica.pdfIn the following web login system Assuming that the applica.pdf
In the following web login system Assuming that the applica.pdf
 
In the following table provide a short explanation of how ea.pdf
In the following table provide a short explanation of how ea.pdfIn the following table provide a short explanation of how ea.pdf
In the following table provide a short explanation of how ea.pdf
 
In the field of anthropology primatology and genetics ther.pdf
In the field of anthropology primatology and genetics ther.pdfIn the field of anthropology primatology and genetics ther.pdf
In the field of anthropology primatology and genetics ther.pdf
 
In the film The Ghosts of Stonehenge it is suggested that.pdf
In the film The Ghosts of Stonehenge it is suggested that.pdfIn the film The Ghosts of Stonehenge it is suggested that.pdf
In the film The Ghosts of Stonehenge it is suggested that.pdf
 
In the fall of 2021 the United States enacted a 12 trilli.pdf
In the fall of 2021 the United States enacted a 12 trilli.pdfIn the fall of 2021 the United States enacted a 12 trilli.pdf
In the fall of 2021 the United States enacted a 12 trilli.pdf
 
In the early 2000s manatee numbers in Florida were hoverin.pdf
In the early 2000s manatee numbers in Florida were hoverin.pdfIn the early 2000s manatee numbers in Florida were hoverin.pdf
In the early 2000s manatee numbers in Florida were hoverin.pdf
 
In the 1960s the Supreme Court of Chief Justice Earl Warren.pdf
In the 1960s the Supreme Court of Chief Justice Earl Warren.pdfIn the 1960s the Supreme Court of Chief Justice Earl Warren.pdf
In the 1960s the Supreme Court of Chief Justice Earl Warren.pdf
 
In Python I am struggling with getting the functions to wor.pdf
In Python I am struggling with getting the functions to wor.pdfIn Python I am struggling with getting the functions to wor.pdf
In Python I am struggling with getting the functions to wor.pdf
 
In the Bully leader election algorithm if a process receive.pdf
In the Bully leader election algorithm if a process receive.pdfIn the Bully leader election algorithm if a process receive.pdf
In the Bully leader election algorithm if a process receive.pdf
 

Recently uploaded

1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 

Recently uploaded (20)

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
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
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.
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
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
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
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
 

In java this manages a list of flower names public class Flo.pdf

  • 1. In java this manages a list of flower names public class FlowerList { private static final int LISTLEN = 6; private String[] list = new String[LISTLEN]; public FlowerList() { list[0] = "daisy"; list[1] = "rose"; list[2] = "lily"; list[3] = "dandelion"; list[4] = "thistle"; list[5] = "sunflower"; } public String getFlowerAtPosition(int pos) { } public String listAllTheFlowers() { } public String listFirstCharacters() { } public String listBackwardsCapitalized() { } } This class has one instance variable which is an array of strings named list. It also has a constructor which initializes the values in the list. 1. Fill in the method public String getFlowerAtPosition(int pos) that returns the String at a given position. If the position is out of bounds, it should return an empty strings. 2. Fill in the method public String listAllTheFlowers() which should return a string consisting of all of the flower names concatenated together.
  • 2. 3. Fill in the method public String listFirstCharacters() Which should return the string consisting of just the first characters of each flower name, separated by newlines. 4. Fill in the method public String listBackwardsCapitalized() This should return the string consisting of the flower names in reverse order and in all capital letters. In java this manages a list of flower names public class FlowerList { private static final int LISTLEN = 6; private String[] list = new String[LISTLEN]; public FlowerList() { list[0] = "daisy"; list[1] = "rose"; list[2] = "lily"; list[3] = "dandelion"; list[4] = "thistle"; list[5] = "sunflower"; } public String getFlowerAtPosition(int pos) { } public String listAllTheFlowers() { } public String listFirstCharacters() {
  • 3. } public String listBackwardsCapitalized() { } } This class has one instance variable which is an array of strings named list. It also has a constructor which initializes the values in the list. 1. Fill in the method public String getFlowerAtPosition(int pos) that returns the String at a given position. If the position is out of bounds, it should return an empty strings. 2. Fill in the method public String listAllTheFlowers() which should return a string consisting of all of the flower names concatenated together. 3. Fill in the method public String listFirstCharacters() Which should return the string consisting of just the first characters of each flower name, separated by newlines. 4. Fill in the method public String listBackwardsCapitalized()
  • 4. This should return the string consisting of the flower names in reverse order and in all capital letters.