Create a new java application called patternmaker

Assignment Help JAVA Programming
Reference no: EM131879189

Question 1. Create a new Java application called "PatternMaker" (without the quotation marks) according to the following guidelines.

The program prompts the user for five input values:

1. An integer value between 1 and 10 (inclusive) for the number of rows to be printed
2. A second integer value between 1 and 10 (inclusive) for the number of columns to be printed
3. A string value for the starting string of the pattern
4. A string value for the second string of the pattern
5. A string value that separates the first two strings
The program must use nested for loops to print a rectangular array of alternating first and second strings of the pattern, separated by the separator string and such that the first string in the first row uses the "first string" provided by the user, but each subsequent row alternates the starting string between the "second string" the user provided and the "first string" the user provided.

So, for instance, if the user enters 5 for the number of rows, 7 for the number of columns, and "XX" for the first string, "OO" for the second string, and "***" for the separator, your program should print the following rectangular pattern.
XX***OO***XX***OO***XX***OO***XX
OO***XX***OO***XX***OO***XX***OO
XX***OO***XX***OO***XX***OO***XX
OO***XX***OO***XX***OO***XX***OO
XX***OO***XX***OO***XX***OO***XX
- Note the requirement for this program to use nested for loops (Horstmann section 4.3).
- Note that there is no delimiter at the end of the lines.
- The logic needed for the nested for loops is a bit tricky. Try writing out the logic for simple cases (e.g., 2 rows and 3 columns).

Question 2. Create a new Java application called "AtmSimDoLoop" (without the quotation marks) that simulates a simple ATM according to the following guidelines.

The program should start with an initial account balance, which you can set to any legitimate double value. All output of currency values should include a leading dollar sign and use two decimal positions. Prompt the user with the following prompt (without the dashed lines) using a do loop.
________________________________________
Enter the number of your desired transaction type.
1. Balance
2. Deposit
3. Withdrawal
4. Quit
________________________________________
- If a balance is requested, the program should output "Your current balance is $X.XX" where X.XX is the initial balance, and then re-display the prompt and await the next transaction type.
- If a deposit is requested, prompt the user to enter the amount of the deposit (use a double for this). Add the deposit amount to the initial balance and then print "Your current balance is $X.XX" where X.XX is the new balance after the deposit, and then re-display the prompt and await the next transaction type.
- If a withdrawal is requested, prompt the user to enter the amount of the withdrawal (use a double for this). If the proposed withdrawal amount is less than or equal to the initial balance, print "Your current balance is $X.XX" where X.XX is the new balance after the withdrawal, and then re-display the prompt and await the next transaction type. If the proposed withdrawal amount exceeds the initial balance, print "Insufficient funds. Your current balance is $X.XX" where X.XX is the initial balance, and then re-display the prompt and await the next transaction type.

If "Quit" is requested, the program should print "Good-bye" and then stop.

Note that you need to keep track of the current balance during each iteration of the loop.

Question 3.

Create a new Java application called "MultiTable" (without the quotation marks) that uses nested for loops to print a multiplication table as shown below.

The value of each cell should be computed using the values in the row and column headings (e.g., 1 * 1; 1 * 2; 1 * 3; etc.).
Make sure to match the below results as shown.
* | 1 2 3 4 5 6 7 8 9
-------------------------------
1 | 1 2 3 4 5 6 7 8 9
2 | 2 4 6 8 10 12 14 16 18
3 | 3 6 9 12 15 18 21 24 27
4 | 4 8 12 16 20 24 28 32 36
5 | 5 10 15 20 25 30 35 40 45
6 | 6 12 18 24 30 36 42 48 54
7 | 7 14 21 28 35 42 49 56 63
8 | 8 16 24 32 40 48 56 64 72
9 | 9 18 27 36 45 54 63 72 81

Question 4.

Create a new Java application called "CharCounter" (without the quotation marks) that gets two Strings called inputEntry and inputCharacter from the user at the command line. Allow for the inputEntry String to be one or more words of input. Check that the inputCharacter String has a length of 1 and note these validations:

- If it doesn't, provide the user with suitable feedback and conclude the program.
- If the inputCharacter length is valid (i.e., it has a length of 1), use a while loop to check each position in the inputEntry variable and return the number of times the character occurs. For example, if the inputEntry is "test" and the inputCharacter is "e" you would output: "There is 1 occurrence(s) of 'e' in test."

Question 5.

Create a new Java application called "Averager" (without the quotation marks) to get positive (i.e., any number greater than 0), double numbers from the user at the command line until they enter -1 (the sentinel). Use a do-while loop. Compute the average of the series of numbers and print the average to the command line. Don't include the sentinel in calculation of the average. Include suitable data validations for invalid data (e.g. the user enters a letter instead of a number), but stay in the loop until the sentinel is entered.

Question 6.

Create a new Java application called "Rooter" (without the quotation marks) to get a positive integer (i.e. any number greater than 0) called "start" from the user at the command line and then find the square root of every number from "start" down through 0. Use a while loop to count down. As an example, if the user entered 8, you would find the square root of 8, then the square root of 7, and so on.

Print each square root on a separate line. Include data validation to ensure the user provides a positive integer. If the validation is not passed, provide the user with suitable feedback and stay in the program to let the user try again until valid input is received. Use the Math.sqrt(double a) method to find each square root and output the integer and four decimal positions.

Question 7.

Create a new Java application called "EvenThough" (without the quotation marks) that uses a while loop to check the integers 1 through 20 and prints only those integers that are even.

Use division to determine an even integer (i.e., when divided by 2 the result yields no remainder).

All output should appear on a single line, but separate each even integer with a comma and a space. Be sure the integer 20 (which is the last expected number you'll output) omits the trailing comma and space.

Verified Expert

Uses nested for loop to create a string pattern.Simulates a simple ATM according to the given guidelines i.e deposit , withdraw and balance check.A multiplication table program for 10x10. Counts the number of occurrence of a character in a given String.Find the average all the positive numbers entered by the user until the user enters -1.Display all the square roots from a user entered number to zero. Prints all the even numbers from 1-20.

Reference no: EM131879189

Questions Cloud

Explain the importance of make-believe play : According to Piaget, children ages two to seven are in the pre- operative stage of development.
Constant rate is stock expected to grow after year three : Carnes Cosmetics Co.'s stock price is $48.92, and it recently paid a $1.00 dividend. At what constant rate is the stock expected to grow after Year 3?
Find the range and the standard deviation : Find the range and the standard deviation of the following prices of backpacks: $11.99, $8.84, $16.98, $9.99, $10.45, $10.86, $11.99.
Explain the public health policy analysis process : Explain the public health policy analysis process. What do you feel are the most important issues regarding public health policy?
Create a new java application called patternmaker : Create a new Java application called PatternMaker and Create a new Java application called MultiTable and Create a new Java application called Averager
Discuss each type of mco-hmo-ppo-and-pos : discuss each type of managed care organization (MCO)-health maintenance organization (HMO), preferred provider organization (PPO), and point of sale (POS).
Considering new three-year expansion project : Keiper, Inc., is considering a new three-year expansion project that requires an initial fixed asset investment of $2.64 million.
Probability of a randomly selected car crashing : The probability of a randomly selected car crashing during a year in a certain country is 0.0499.
Discuss the definition of sense of meaningfulness : Discuss the definition of sense of meaningfulness as it applies to the work force. You will provide examples of when you have had a high sense of meaningfulness

Reviews

len1879189

2/26/2018 2:29:41 AM

Can you guys help me with my java fundamentals(loops) assignment? I need the code which I will also run myself on NetBeans for its workability Simple line of code Let me know what you think. Thanks.

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd