Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

12. String Manipulator Write a program that asks the user to enter the name of his or her favorite city. Use a String variable to

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
12. String Manipulator Write a program that asks the user to enter the name of his or her favorite city. Use a String variable to store the input. The program should display the following: The number of characters in the city name The name of the city in all uppercase letters The name of the city in all lowercase letters The first character in the name of the city 20. Planting Grapevines A vineyard owner is planting several new rows of grapevines and needs to know how many grapevines to plant in each row. She has determined that after measuring the length of a future row, she can use the following formula to calculate the number of vines that will fit! in the row, along with the trellis end-post assemblies that will need to be constructed at each end of the row: R- 2E V = S The terms in the formula are: V is the number of grapevines that will fit in the row. R is the length of the row, in feet. E is the amount of space used by an end-post assembly. S is the space between vines, in feet. 110 Chapter 2 Java Fundamentals makes the calculation for the vineyard owner. The program should ask Write a program that makes the calculat the user to input the following: The length of the row, in feet sembly, in feet ne amount of space used by an end-post assembly, in tec The amount of space between the vines, in feet Once the input data has been entered, th put data has been entered the program should calculate and display the number of grapevines that will fit in the row. sks the user to enter three names, and then displays the names sorted for example, if the user entered "Charlie", "Leslie", and "Andy", the 7. Sorted Names Write a program that asks the user to enter three names in ascending order. For example, if the user entered "Charlie program would display: Andy Charlie Leslie 8. Software Sales A software company sells a package that retails for $99. Quantity discounts are given accord- ing to the following table: Quantity 10-19 20-49 Discount 20% 30% Programming Challenges 1 Quantity 50-99 100 or more Discount 40% 50% Write a program that asks the user to enter the number of packages purchased. The program should then display the amount of the discount (if any) and the total amount of the purchase after the discount. 12. String Manipulator Write a program that asks the user to enter the name of his or her favorite city. Use a String variable to store the input. The program should display the following: The number of characters in the city name The name of the city in all uppercase letters The name of the city in all lowercase letters The first character in the name of the city 20. Planting Grapevines A vineyard owner is planting several new rows of grapevines and needs to know how many grapevines to plant in each row. She has determined that after measuring the length of a future row, she can use the following formula to calculate the number of vines that will fit in the row, along with the trellis end-post assemblies that will need to be constructed at each end of the row: V =R - 2E S The terms in the formula are: V is the number of grapevines that will fit in the row. R is the length of the row, in feet. E is the amount of space used by an end-post assembly. S is the space between vines, in feet. he program should ask Write a program that makes the calculation for the vineyard owner. The program the user to input the following: The length of the row, in feet The amount of space used by an end-post assembly, in feet The amount of space between the vines, in feet Once the input data has been entered, the program should calculate and display the of grapevines that will fit in the row. calculate and display the number to enter three names, and then displays the names sorted 7. Sorted Names Write a program that asks the user to enter three names, and then displays the in ascending order. For example, if the user entered "Charlie", "Leslie", and "Anay, the program would display: Andy Charlie Leslie 8. Software Sales A software company sells a package that retails for $99. Quantity discounts are given accord- ing to the following table: Quantity Discount 10-19 20% 20-49 30% Programming Challenges 183 Discount Quantity 50-99 100 or more 40% 50% Write a program that asks the user to enter the number of packages purchased. The program should then display the amount of the discount (if any) and the total amount of the purchase after the discount

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database 11g SQL

Authors: Jason Price

1st Edition

0071498508, 978-0071498500

More Books

Students also viewed these Databases questions

Question

1 8 . 5 lab: program: phone directory python

Answered: 1 week ago