Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Java 1. (12 Points) Write a program PrintMatrix.java that performs the following, Ask user to enter number of rows and columns of a matrix

Using Javaimage text in transcribed

1. (12 Points) Write a program PrintMatrix.java that performs the following, Ask user to enter number of rows and columns of a matrix . Use loop to print a matrix of random digits (1 through 9).j Option: Total the numbers in each row and print out the row total Sample output Enter number of rows: 3 Enter number of columns: 6 Matrix 923226 535113 1 69 3 14 Row Total 24 18 24 2. (14 points) A group of friends is organizing a ski trip. Write a program CostEstimate.java that performs the following, Hotel room cost is $120 per day and is limited to 4 people. Lift ticket costs as follows For a group with 1-5 people, cost is $90 per person per day For a group with 6-10 people, cost is $80 per person per day For a group with more than 10 people cost is $70 per person People in the group will split the total cost evenly. Define a method called splitCost which takes one parameter, the number of people, calculates the per person price (room cost plus lift tickets cost), then returns the cost per person . . . Call splitCost method in the program to take user input of the size of the group, then estimate the trip cost per person per day. Program should be able to do multiple estimates until user enters -1 to quit Sample output Enter group size (-1 to quit): 2 Cost estimate per person per day: $150.00 Enter group size (-1 to quit): 3 Cost estimate per person per day: $130.00 Enter group size (-1 to quit): 5 Cost estimate per person per day: $138.00 Enter group size (-1 to quit): 7 Cost estimate per person per day: $114.29 Enter group size (-1 to quit): 12 Cost estimate per person per day: $100.00 Enter group size (-1 to quit):-1

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

Step: 3

blur-text-image

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

Sams Teach Yourself Beginning Databases In 24 Hours

Authors: Ryan Stephens, Ron Plew

1st Edition

067232492X, 978-0672324925

More Books

Students also viewed these Databases questions

Question

use and understand the formulas in this chapter.

Answered: 1 week ago

Question

How do Excel Pivot Tables handle data from non OLAP databases?

Answered: 1 week ago