10/9/22, 1:09 PM Assignment 3: Strings and Method Overloadinghttps://webcourses.ucf.edu/courses/1413634/assignments/ XXXXXXXXXX/5Assignment 3: Strings and Method OverloadingDue Oct 7 by 11:59pm...

1 answer below »
please no plagiarism


10/9/22, 1:09 PM Assignment 3: Strings and Method Overloading https://webcourses.ucf.edu/courses/1413634/assignments/7720812 1/5 Assignment 3: Strings and Method Overloading Due Oct 7 by 11:59pm Points 100 Submitting a file upload File Types java Available until Oct 21 at 11:59pm Start Assignment The long awaited Strings and Method Overloading assignment. I am sorry it took me so long to post it. I have pushed the assignment back to be turned in on a Monday. Please note the change in the date. ------ Filename: Halloween Halloween is fast approaching and you are working at the candy factory. Your candy bars have a wrapper that has three different things printed on it: Name of the candy, when it expires, and a slogan. Your buddy, Jack loaded the wrong font into the document and it is printing dollar signs in random locations of the label. Jack and you thought since it was halloween time, you could just slap some stickers on it and call it a day. If it is in the title, you will need two stickers for each mistake (dollar sign). If it is in the date with a mistake, we will hide the entire thing (return empty string). However, we will leave it the same if there isn't a mistake (dollar sign). Lastly if it is in the slogan, you will need 1 sticker for each mistake. The sticker roll will be made up of pumpkins, bats, witches, and vampires in that order. Once the pattern is complete it starts again with pumpkins. Stickers: Pumpkin Bat Witch Vampire Here are some examples: Input Type Function Call Returns Hallow$en Name sticker("Hallow$en") HallowPUMPKINBATen C$$$y Name sticker("C$$$y") CPUMPKINBATWITCHVAMPIREPUMPKINBATy Jan 2023 Date sticker("Jan 2023", true) Jan 2023 10/9/22, 1:09 PM Assignment 3: Strings and Method Overloading https://webcourses.ucf.edu/courses/1413634/assignments/7720812 2/5 Jan$ 2023 Date sticker("Jan$ 2023", true) "" <- this is to say it is returns an empty string ju$t candy slogan sticker("ju$t candy", false) jupumpkint candy program specifications create a private static variable to keep track of the current sticker you are on. the stickers do not reset after each call. for example if i call sticker("hallow$en") twice, i will get different answers on the second call because the sticker will change. the examples above assumed i restarted the program. create two public static methods called sticker. both will return a string. sticker(string) will assume the data is the name on the label, and find each $ and replace it with the next two stickers on the roll. capitalize the inserted stickers in the string. sticker(string, boolean) will check to see if it is a date or not. if the boolean is true, then it is a date. otherwise it is a slogan. write a main method that does the following: asks the user what type of data, name, date, slogan or exit as a string. cleans the input so a user can put multiple versions and it can still work correctly. examples: "name", "name", " name " asks the user what is the input. calls the correct method. repeats the steps above until the user types exit. example run what type of data? name what is the message? hallow$en hallowpumpkinbaten what type of data? name what is the message? c$$$y cwitchvampirepumpkinbatwitchvampirey what type of data? date what is the message? oct 2022 oct 2022 what type of data? date what is the message? dec $ 2022 what type of data? slogan what is the message? ucf stands for opportunity$ ucf stands for opportunitypumpkin 10/9/22, 1:09 pm assignment 3: strings and method overloading https://webcourses.ucf.edu/courses/1413634/assignments/7720812 3/5 some rubric (1) what type of data? exit 10/9/22, 1:09 pm assignment 3: strings and method overloading https://webcourses.ucf.edu/courses/1413634/assignments/7720812 4/5 criteria ratings pts 5 pts 5 pts 10 pts 35 pts does it run? does it run without error? 5 pts yes 0 pts no include header comment? did you include header comment? (name, date, class, assignment title) 5 pts yes 0 pts no static variables did you create a static variable to keep track of which sticker you are on? 10 pts yes 0 pts no sticker(string) method does the sticker do the following? 1. written correctly? (returns a string, takes in a string) 2. locate at least one $ 3. replace the $ with two of the keywords from the list 4. keywords were selected based on the rotation 5. builds a new word based on this information correctly 6. returns a constructed word 35 pts yes 29 pts 5/6 22 pts 4/6 15 pts 3/5 0 pts no 2 or less things accomplished. 10/9/22, 1:09 pm assignment 3: strings and method overloading https://webcourses.ucf.edu/courses/1413634/assignments/7720812 5/5 total points: 100 criteria ratings pts 45 pts sticker(string, boolean) method does the sticker do the following? 1. written correctly? (returns a string, takes in a string and boolean) 2. locate at least one $ 3. if slogan replace the $ with one of the keywords from the list 4. keywords were selected based on the rotation 5. builds a new word based on this information correctly 6. returns a constructed word 7. if date return the date if no $ is located 8. return an empty string if the date has a $ 45 pts yes 39 pts 7/8 33 pts 6/8 27 pts 5/8 20 pts 4/8 0 pts no 3 or less things accomplished. 10/9/22, 1:11 pm assignment 4: file i/o & linked lists https://webcourses.ucf.edu/courses/1413634/assignments/7720830 1/2 assignment 4: file i/o & linked lists due oct 21 by 11:59pm points 100 submitting a file upload file types java available until nov 4 at 11:59pm start assignment goal: our goal is to use a linked list class (javadoc (https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/linkedlist.html) ). you must use the linked list object and not write your own. prompt you are working in a store with two different lines to help people. one of these lines is for people who just want to check out, the other is for people who want to return an item. in most retail situations, the user will get into the checkout line and then told they need to join the customer service line once they get up front. your job is to simulate these two lines. the store will process 2 purchases for every 1 return. this will be made clear in the example. code requirements there will be two classes. store and customer. customer class includes name (string) and if they are buying (false) or returning (true) includes a constructor that takes in a string and a boolean. (see variables) includes two instance methods to return the name (getname()) and if they are returning (getbusiness()) store class includes two static linkedlists that store customers includes a main method ask the user what is the name of the file they would like to load. assume the file is in the root directory. main method reads information from the file. each customer will be in one line. load everyone in the file into the checkout line. each cycle do the following: take out two people out of the checkout line. if they are buying print "name checkout" if they are returning print "name forwarded to return line" https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/linkedlist.html 10/9/22, 1:11 pm assignment 4: file i/o & linked lists https://webcourses.ucf.edu/courses/1413634/assignments/7720830 2/2 if they are returning also put them in the return line. take out one person out of the return line. print out "name returned an item" example: text file: 5 john true sally false sarah false ray true juan true the output should be: john was forwarded to the return line. sally checked out john returned an item sarah checked out ray was forwarded to the return line. ray returned an item juan was forwarded to the return line. juan returned an item this="" is="" to="" say="" it="" is="" returns="" an="" empty="" string="" ju$t="" candy="" slogan="" sticker("ju$t="" candy",="" false)="" jupumpkint="" candy="" program="" specifications="" create="" a="" private="" static="" variable="" to="" keep="" track="" of="" the="" current="" sticker="" you="" are="" on.="" the="" stickers="" do="" not="" reset="" after="" each="" call.="" for="" example="" if="" i="" call="" sticker("hallow$en")="" twice,="" i="" will="" get="" different="" answers="" on="" the="" second="" call="" because="" the="" sticker="" will="" change.="" the="" examples="" above="" assumed="" i="" restarted="" the="" program.="" create="" two="" public="" static="" methods="" called="" sticker.="" both="" will="" return="" a="" string.="" sticker(string)="" will="" assume="" the="" data="" is="" the="" name="" on="" the="" label,="" and="" find="" each="" $="" and="" replace="" it="" with="" the="" next="" two="" stickers="" on="" the="" roll.="" capitalize="" the="" inserted="" stickers="" in="" the="" string.="" sticker(string,="" boolean)="" will="" check="" to="" see="" if="" it="" is="" a="" date="" or="" not.="" if="" the="" boolean="" is="" true,="" then="" it="" is="" a="" date.="" otherwise="" it="" is="" a="" slogan.="" write="" a="" main="" method="" that="" does="" the="" following:="" asks="" the="" user="" what="" type="" of="" data,="" name,="" date,="" slogan="" or="" exit="" as="" a="" string.="" cleans="" the="" input="" so="" a="" user="" can="" put="" multiple="" versions="" and="" it="" can="" still="" work="" correctly.="" examples:="" "name",="" "name",="" "="" name="" "="" asks="" the="" user="" what="" is="" the="" input.="" calls="" the="" correct="" method.="" repeats="" the="" steps="" above="" until="" the="" user="" types="" exit.="" example="" run="" what="" type="" of="" data?="" name="" what="" is="" the="" message?="" hallow$en="" hallowpumpkinbaten="" what="" type="" of="" data?="" name="" what="" is="" the="" message?="" c$$$y="" cwitchvampirepumpkinbatwitchvampirey="" what="" type="" of="" data?="" date="" what="" is="" the="" message?="" oct="" 2022="" oct="" 2022="" what="" type="" of="" data?="" date="" what="" is="" the="" message?="" dec="" $="" 2022="" what="" type="" of="" data?="" slogan="" what="" is="" the="" message?="" ucf="" stands="" for="" opportunity$="" ucf="" stands="" for="" opportunitypumpkin="" 10/9/22,="" 1:09="" pm="" assignment="" 3:="" strings="" and="" method="" overloading="" https://webcourses.ucf.edu/courses/1413634/assignments/7720812="" 3/5="" some="" rubric="" (1)="" what="" type="" of="" data?="" exit="" 10/9/22,="" 1:09="" pm="" assignment="" 3:="" strings="" and="" method="" overloading="" https://webcourses.ucf.edu/courses/1413634/assignments/7720812="" 4/5="" criteria="" ratings="" pts="" 5="" pts="" 5="" pts="" 10="" pts="" 35="" pts="" does="" it="" run?="" does="" it="" run="" without="" error?="" 5="" pts="" yes="" 0="" pts="" no="" include="" header="" comment?="" did="" you="" include="" header="" comment?="" (name,="" date,="" class,="" assignment="" title)="" 5="" pts="" yes="" 0="" pts="" no="" static="" variables="" did="" you="" create="" a="" static="" variable="" to="" keep="" track="" of="" which="" sticker="" you="" are="" on?="" 10="" pts="" yes="" 0="" pts="" no="" sticker(string)="" method="" does="" the="" sticker="" do="" the="" following?="" 1.="" written="" correctly?="" (returns="" a="" string,="" takes="" in="" a="" string)="" 2.="" locate="" at="" least="" one="" $="" 3.="" replace="" the="" $="" with="" two="" of="" the="" keywords="" from="" the="" list="" 4.="" keywords="" were="" selected="" based="" on="" the="" rotation="" 5.="" builds="" a="" new="" word="" based="" on="" this="" information="" correctly="" 6.="" returns="" a="" constructed="" word="" 35="" pts="" yes="" 29="" pts="" 5/6="" 22="" pts="" 4/6="" 15="" pts="" 3/5="" 0="" pts="" no="" 2="" or="" less="" things="" accomplished.="" 10/9/22,="" 1:09="" pm="" assignment="" 3:="" strings="" and="" method="" overloading="" https://webcourses.ucf.edu/courses/1413634/assignments/7720812="" 5/5="" total="" points:="" 100="" criteria="" ratings="" pts="" 45="" pts="" sticker(string,="" boolean)="" method="" does="" the="" sticker="" do="" the="" following?="" 1.="" written="" correctly?="" (returns="" a="" string,="" takes="" in="" a="" string="" and="" boolean)="" 2.="" locate="" at="" least="" one="" $="" 3.="" if="" slogan="" replace="" the="" $="" with="" one="" of="" the="" keywords="" from="" the="" list="" 4.="" keywords="" were="" selected="" based="" on="" the="" rotation="" 5.="" builds="" a="" new="" word="" based="" on="" this="" information="" correctly="" 6.="" returns="" a="" constructed="" word="" 7.="" if="" date="" return="" the="" date="" if="" no="" $="" is="" located="" 8.="" return="" an="" empty="" string="" if="" the="" date="" has="" a="" $="" 45="" pts="" yes="" 39="" pts="" 7/8="" 33="" pts="" 6/8="" 27="" pts="" 5/8="" 20="" pts="" 4/8="" 0="" pts="" no="" 3="" or="" less="" things="" accomplished.="" 10/9/22,="" 1:11="" pm="" assignment="" 4:="" file="" i/o="" &="" linked="" lists="" https://webcourses.ucf.edu/courses/1413634/assignments/7720830="" 1/2="" assignment="" 4:="" file="" i/o="" &="" linked="" lists="" due="" oct="" 21="" by="" 11:59pm="" points="" 100="" submitting="" a="" file="" upload="" file="" types="" java="" available="" until="" nov="" 4="" at="" 11:59pm="" start="" assignment="" goal:="" our="" goal="" is="" to="" use="" a="" linked="" list="" class="" (javadoc="" (https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/linkedlist.html)="" ).="" you="" must="" use="" the="" linked="" list="" object="" and="" not="" write="" your="" own.="" prompt="" you="" are="" working="" in="" a="" store="" with="" two="" different="" lines="" to="" help="" people.="" one="" of="" these="" lines="" is="" for="" people="" who="" just="" want="" to="" check="" out,="" the="" other="" is="" for="" people="" who="" want="" to="" return="" an="" item.="" in="" most="" retail="" situations,="" the="" user="" will="" get="" into="" the="" checkout="" line="" and="" then="" told="" they="" need="" to="" join="" the="" customer="" service="" line="" once="" they="" get="" up="" front.="" your="" job="" is="" to="" simulate="" these="" two="" lines.="" the="" store="" will="" process="" 2="" purchases="" for="" every="" 1="" return.="" this="" will="" be="" made="" clear="" in="" the="" example.="" code="" requirements="" there="" will="" be="" two="" classes.="" store="" and="" customer.="" customer="" class="" includes="" name="" (string)="" and="" if="" they="" are="" buying="" (false)="" or="" returning="" (true)="" includes="" a="" constructor="" that="" takes="" in="" a="" string="" and="" a="" boolean.="" (see="" variables)="" includes="" two="" instance="" methods="" to="" return="" the="" name="" (getname())="" and="" if="" they="" are="" returning="" (getbusiness())="" store="" class="" includes="" two="" static="" linkedlists="" that="" store="" customers="" includes="" a="" main="" method="" ask="" the="" user="" what="" is="" the="" name="" of="" the="" file="" they="" would="" like="" to="" load.="" assume="" the="" file="" is="" in="" the="" root="" directory.="" main="" method="" reads="" information="" from="" the="" file.="" each="" customer="" will="" be="" in="" one="" line.="" load="" everyone="" in="" the="" file="" into="" the="" checkout="" line.="" each="" cycle="" do="" the="" following:="" take="" out="" two="" people="" out="" of="" the="" checkout="" line.="" if="" they="" are="" buying="" print="" "name="" checkout"="" if="" they="" are="" returning="" print="" "name="" forwarded="" to="" return="" line"="" https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/linkedlist.html="" 10/9/22,="" 1:11="" pm="" assignment="" 4:="" file="" i/o="" &="" linked="" lists="" https://webcourses.ucf.edu/courses/1413634/assignments/7720830="" 2/2="" if="" they="" are="" returning="" also="" put="" them="" in="" the="" return="" line.="" take="" out="" one="" person="" out="" of="" the="" return="" line.="" print="" out="" "name="" returned="" an="" item"="" example:="" text="" file:="" 5="" john="" true="" sally="" false="" sarah="" false="" ray="" true="" juan="" true="" the="" output="" should="" be:="" john="" was="" forwarded="" to="" the="" return="" line.="" sally="" checked="" out="" john="" returned="" an="" item="" sarah="" checked="" out="" ray="" was="" forwarded="" to="" the="" return="" line.="" ray="" returned="" an="" item="" juan="" was="" forwarded="" to="" the="" return="" line.="" juan="" returned="" an="">
Answered 8 days AfterOct 09, 2022

Answer To: 10/9/22, 1:09 PM Assignment 3: Strings and Method...

Vibhav answered on Oct 18 2022
52 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here