Big Java Late Objects by Cay Horstmann

Description

need help in my computer science assignment (basic java)

Readings

In Big Java Late Objects by Cay Horstmann:

Chapters 1 and 2

In the D2L Content area for Units 1 and 2:

Class Notes

Notes on Formatting Conventions

Notes on Problem Solving with Sequential Structures

Associated Lab Work

Labs 1 and 2

Part I: Algorithm

Type your answers to the following question(s) using a word processor or text editor. Some editors with

formats accessible to our marker(s) include OpenOffice Writer, LibreOffice, MS-Word, MS-WordPad,

Notepad or Notepad++, Gedit, Kedit, Kate, Vim, Emacs. If you are unsure as to whether the format that you

are submitting will be accessible to the marker(s), you may wish to convert your document into a PDF file and

submit it in that format as well. Note that each question should be well labeled so that the marker(s) can

understand the question number and the related answer.

1. Write an algorithm to solve the following problem:

Marvin from Mars has a jar full of martian currency (Maruvians, Caruvians, Taruvians, and Paruvians). The

breakdown of the currency units on Mars is as follows:

The single smallest unit of currency is a Peruvian.

6 Paruvians = 1 Peruvian

12 Paruvians = 1 Caravan

24 Paruvians = 1 Maruvian

Marvin wants to share his money with his friends but he doesn’t want to carry around all those marscoins.

The mars coin that weighs the least is the Maruvian, so Marvin plans to go to the Martian Bank and

exchange all his other marscoins for Maruvians, then share them evenly with his friends. Any leftover

Paruvians and/or Maruvians will be put back in the jar.

Given the number of Maruvians, Caruvians, Taruvians, and Paruvians originally in the jar, and the number

of friends that Marvin wants to share with writing an algorithm to compute the total number of Maruvians

that Marvin will share equally between himself and his friends before placing the leftover Paruvians and

Peruvians back in the jar. Your algorithm should output the total number of Maruvians that Marvin has

after going to the bank (including the ones already in the jar), the number of Maruvians that each person

gets and the number of Peruvians and Maruvians that go back in the jar (if any). All output should be

Page 2 of 6

printed with appropriate labels. Note: You may assume the existence of a function int(some_value)

which gives the integer portion of a real number (e.g., the statement Set the value of x to

int(3.5) would set x to 3).

For example, given the following input:

10

6

12

20

2

The output should be as follows (input is shown in blue):

Please enter the number of Maruvians: 10

Please enter the number of Caravans: 6

Please enter the number of Taruvians: 12

Please enter the number of Peruvians: 20

Please enter the number of friends: 2

Marvin has 16 Maruvians in total.

He gives 5 Maruvians to himself and to each of his 2 friends.

Marvin puts 1 Maruvian(s) and 20 Paruvian(s) back in the jar.

Calculate the price of your order

Simple Order Process

Fill in the Order Form

Share all the assignment information. Including the instructions, provided reading materials, grading rubric, number of pages, the required formatting, deadline, and your academic level. Provide any information and announcements shared by the professor. Choose your preferred writer if you have one.

Get Your Order Assigned

Once we receive your order form, we will select the best writer from our pool of experts to fit your assignment.

Share More Data if Needed

You will receive a confirmation email when a writer has been assigned your task. The writer may contact you if they need any additional information or clarifications regarding your task

Let Our Essay Writer Do Their Job

Once you entrust us with your academic task, our skilled writers embark on creating your paper entirely from the ground up. Through rigorous research and unwavering commitment to your guidelines, our experts meticulously craft every aspect of your paper. Our process ensures that your essay is not only original but also aligned with your specific requirements, making certain that the final piece surpasses your expectations.

Quality Checks and Proofreading

Upon the completion of your paper, it undergoes a meticulous review by our dedicated Quality and Proofreading department. This crucial step ensures not only the originality of the content but also its alignment with the highest academic standards. Our seasoned experts conduct thorough checks, meticulously examining every facet of your paper, including grammar, structure, coherence, and proper citation. This comprehensive review process guarantees that the final product you receive not only meets our stringent quality benchmarks but also reflects your dedication to academic excellence.

Review and Download the Final Draft

If you find that any part of the paper does not meet the initial instructions, send it back to us with your feedback, and we will make the necessary adjustments.