Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create the following programs in Java. (Do not use Arrays etc, keep it simple) a. Write one program named PartA that does the following: Write

Create the following programs in Java. (Do not use Arrays etc, keep it simple)

a. Write one program named PartA that does the following:

  • Write a method named printText that prints a simple thank you for your business style message for a company. The method takes no arguments.

  • Write a method named mathHelp that takes two arguments: two integers. The integers are then squared, added and the result printed on the screen.

  • Write a method named printChar that takes three arguments: a character and two integers. The character is to be printed using a nested loop. The first integer specifies the number of times that the character is to be printed on a line, and the second integer specifies the number of lines that are to be printed.

b. Write a program name CatAndMice that uses 2 methods to print: Three blind mice Three blind mice See how they run See how they run They all run after the farmer's wife. One method, named mice, prints the phrase "Three blind mice" and is invoked twice. The other method, named run, prints the phrase "See how they run" and is invoked twice. Produce the output shown above by calling your methods in the main method. The last line is a literal print in main.

c. Write a program named Address that utilizes two methods. The first method, named symbols, prints 30 $-symbols horizontally (you must use a loop for this!). The second method, named address, prints your name, address, and city, state, zip on three separate lines. The program will invoke the methods in main in such a manner as to produce two lines of $-symbols, followed by your personal information, followed by three more lines of $-symbols.

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

Introduction To Constraint Databases

Authors: Peter Revesz

1st Edition

1441931554, 978-1441931559

More Books

Students also viewed these Databases questions