Task 1 – Multiple choice, string comparison (case insensitiv

Wridemy Plagiarism Free Paper Writing Website. Visit us here Wridemy

Task 1 – Multiple choice, string comparison (case insensitive),Java file: HW3_Faces.javaWrite a program that allows the user to print one of 4 possible faces. The options for faces are:bo – Bold, Open eyesbc – Bold, Closed eyesho – Hat, Open eyeshc – Hat, Closed eyesThe program should be case insensitive, meaning that it will work well with both upper case and lower case letters or a combination of those. E.g.all these are valid choices: bo, BO, bO, Bo.Hints:You may want to use the s.toLowerCase() or s.toUpperCase() where s is a string. Keep in mind that they do not modify s, but they return a new string.Do NOT use == to compare strings.Develop your program gradually.——- Sample run 1Enter face choice (bo/bc/ho/hc): ho _______ __|_______|___ | o o | | ^ | – / —–Bye ——- Sample run 2 (Note: case insensitive: works for Uppercase letters as well)Enter face choice (bo/bc/ho/hc): Ho _______ __|_______|___ | o o | | ^ | – / —–Bye——- Sample run 3Enter face choice (bo/bc/ho/hc): bo ——- / | o o | | ^ | – / —–Bye——- Sample run 4Enter face choice (bo/bc/ho/hc): BC ——- / | – – | | ^ | – / —–Bye——- Sample run 5Enter face choice (bo/bc/ho/hc): hc _______ __|_______|__ | – – | | ^ | – / —–Bye Task 2File: HW3_Wiki.javaWIkipedia pages have a specific webpage address. Any address starts with https://en.wikipedia.org/wiki/ and then continues with the topic for that page e.g. Computer_science, Java_(programming_language). See examples below:https://en.wikipedia.org/wiki/Computer_sciencehttps://en.wikipedia.org/wiki/Java_(programming_language)https://en.wikipedia.org/wiki/Imagine_Dragons Write a program that reads a string from the user. If it is a valid wikipedia webpage, it extracts and prints the topic for that page. If it is not a valid address it prints the message Not a valid wikipedia webpage address.Hint: How can the fact that all valid addresses start with the same text before the topic name help you extract the topic name?You do NOT need to handle the case where the webpage address is correct, but it is written in uppercase letters. You can assume it is all lowercase.—- Sample run 1 This program will extract the topic from a valid Wikipedia webpage address.Enter a web address: https://en.wikipedia.org/wiki/Computer_scienceTopic: Computer_scienceBye.—- Sample run 2 This program will extract the topic from a valid Wikipedia webpage address.Enter a web address: http://vlm1.uta.edu/~alex/courses/1310/homework/hw02.htmlNot a valid wikipedia webpage address.Bye.—- Sample run 3 (note that even though this is a special case, you should NOT need to do anything special about it. The code that works for normal cases will just for this as well.)This program will extract the topic from a valid Wikipedia webpage address.Enter a web address: https://en.wikipedia.org/wiki/Topic: Bye.Task 3 – complex boolean expression or nested if-statementsJava file: HW3_Aries.javaWrite a program that reads the month and the day from the user and prints whether or not someone born on that date is under the Aries astrological sign or not.Anyone born between and including March 21 and April 19 is Aries.You can assume that the month and day are given as integer numbers (e.g. do not worry about user enterring March)Hint: write the condition for an Aries date in March. Write the condition for April. Put these two together.— Sample run:Enter the month: 3Enter the day: 21Aries.— Sample run:Enter the month: 4Enter the day: 19Aries.— Sample run:Enter the month: 3Enter the day: 27Aries.— Sample run:Enter the month: 4Enter the day: 6Aries.— Sample run:Enter the month: 3Enter the day: 40Not Aries.— Sample run:Enter the month: 4Enter the day: -5Not Aries.— Sample run:Enter the month: 2Enter the day: 27Not Aries.Extra (for practice, not grade): recognize the month in other formats as well: Mar, March, 3, 03, Apr, April, 4, 04.Task 4 – ‘long’ program, multiple step processing, non-trivial data manipulation, formatted printing, if-statementsJava file name: HW3_Bills.javaWrite a program that asks the user for an amount and calculates and print the minimum number of bills of 20,10,5, and 1 needed to pay that amount.In order to use the minimum number of bills, you must pay as many bills of 20 as possible, and then the largest number of bills of 10 and so on.Logic/ Processing steps:Compute and store the max number of bills of 20. Hint: this is the same as asking how many times can I fit 20 into my amount?Compute the remaining amount. Hint: This is the remainder of dividing the amount by 20.Compute and store the max number of bills of 10.Compute the remaining amount.Compute and store the max number of bills of 5.Compute the remaining amount. Note that this amount (that could not be payed with 20,10 and 5) can only be payed with bills of 1, so this is how many bills of 1 are needed.Print table formatted (aligned) as shown in the sample run. In particular the cells for the number of bills should have a width of 4 spaces. (E.g. see how the number of bills of 20 in sample run 1 (30) and in sample run 2 (3) do not miss align the table cells.)Prints the total number of bills given (of any value).Hints:You should save the number of each bills since you need to use it (to print) twice.A cell in the last row in the table will have nothing printed when the number of bills is 0 and a number otherwise. What Java instruction allows you to choose to do one action or another based on data?To ‘print nothing’ you can print an empty string (”) or a string with just a space in it (‘ ‘).You can print a SINGLE line in Java with SEVERAL printf statements. It does not have to be a single printf.Consider using different printf() for the cell for each bill. So one printf will print ‘ 2|’ and another will print ‘ 1|’, etc.Finally, for the last line, note that as you print the cell, you will have either a number or a space to print.Grading:2 pts – prints message about what program does and gets user input.5 pts – total bills printed at the end: calcuate (4 pts), print (1 pts)4 pts – print table lines: horizontal lines (2 pts), vertical lines (2 pts)4pts – the 2-nd row of the table is formated. It reserves spaces in cells with numbers (especially for bills of 20)1pt – table header row12 pts – calculate and save count of each bill (12 pts: 3 pts per bill)6 points – print the last row with correct spaces instead off 06 pts – program style: good variable names (2 pts), correct indentation (2pts) , comments (2pts)— Sample run 1:This program will calculate the minimum number of bills of 20,10,5, and 1 needed to pay a given amount.Enter the integer amount that you need to pay: 619————————————| Bill value | 20| 10| 5| 1|————————————| Num of bills | 30| 1| 1| 4|————————————| Num of bills | 30| 1| 1| 4|————————————Total bills: 36Bye— Sample run 2:This program will calculate the minimum number of bills of 20,10,5, and 1 needed to pay a given amount.Enter the integer amount that you need to pay: 74————————————| Bill value | 20| 10| 5| 1|————————————| Num of bills | 3| 1| 0| 4|————————————| Num of bills | 3| 1| | 4|————————————Total bills: 8Bye— Sample run 3:This program will calculate the minimum number of bills of 20,10,5, and 1 needed to pay a given amount.Enter the integer amount that you need to pay: 2————————————| Bill value | 20| 10| 5| 1|————————————| Num of bills | 0| 0| 0| 2|————————————| Num of bills | | | | 2|————————————Total bills: 2Bye— Sample run 4:This program will calculate the minimum number of bills of 20,10,5, and 1 needed to pay a given amount.Enter the integer amount that you need to pay: 25————————————| Bill value | 20| 10| 5| 1|————————————| Num of bills | 1| 0| 1| 0|————————————| Num of bills | 1| | 1| |————————————Total bills: 2ByeTry and do the final task first. All program output should match the sample runs exactly.

The post Task 1 – Multiple choice, string comparison (case insensitiv appeared first on Wridemy. Visit us here Wridemy for plagiarism free papers.

CLAIM YOUR 30% OFF TODAY

X
Don`t copy text!
WeCreativez WhatsApp Support
Our customer support team is here to answer your questions. Ask us anything!
???? Hi, how can I help?