Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write this in java please. I use Eclipse Write the following two functions. main doesnt need to be filled up. Function 1: Write a function

Write this in java please. I use Eclipse

Write the following two functions. main doesnt need to be filled up.

Function 1:

Write a function called howMany that takes two arguments: an array of integers called arr, and an integer called iTarget. The function should return an integer result. Inside the function write a loop to go through the array and count the number of elements in the array that have the same value as iTarget. At the end it should return the count as the function return value.

Function 2:

Write a function called endsIn that takes two arguments: a String and a character. The function should return true if the string ends in that character or else return false. (Only if the ending character of the string is the character passed in as an argument.)

You sell the book JAVA for Fools. Write a program that has you enter a years worth of monthly sales (in terms of money). Create an array of string objects initialized to the month strings. The program should use a loop to prompt you by month from this created array of months and storing the input data (sales numbers for each month) in an array of double. Then the program should find the sum of the array contents and report the total sales for the year.

The Kingdom of Mars, where the unit of currency is the Rock, has the following income tax code:

First 3,000 Rocks: 0% tax

Next 5,000 Rocks: 5% tax

Next 10,000 Rocks: 10% tax

Rocks after 18,000: 15% tax

For example, someone earning 30,000 Rocks would owe (3,000 0.00 + 5,000 0.05 + 10,000 0.10 + 12,000 0.15, or) 3,050 Rocks. Write a JAVA program that inputs incomes and calculates the tax owed in the Kingdom of Mars in Rocks.

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

PC Magazine Guide To Client Server Databases

Authors: Joe Salemi

1st Edition

156276070X, 978-1562760700

More Books

Students also viewed these Databases questions

Question

please dont use chat gpt 2 4 .

Answered: 1 week ago