Problem 5A Write a C program to print your initials in block letters. Construct each block...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Problem 5A Write a C program to print your initials in block letters. Construct each block letter out of the letter it represents. An example follows: Student's name: Anteater, Peter J. Output of Peter's C program: AAAAAAAAA A A A A A A AAAAAAAAA PPPPPPPPPPPP JJ P P P P P JJJJJJJJJJJJJJ Write a Java class called Rectangle that represents a rectangular, two-dimensional region. In this lab you learn overriding a system method. Your Rectangle objects should have following methods: public void setFields(int newx, int newy, int newwidth, int newheight) Set the values for the fields in the Rectangle objects whose top-left corner is specified by the given x and y coordinates and by the width and height. public int getHeight() Returns the Rectangle's height. public int getWidth() Returns the Rectangle's width. public int getX() Returns the Rectangle's x-coordinate public int getY()) Returns the Rectangle's y-coordinate public String toString() Returns a String representation of this Rectangle, such as "Rectangle [x=2, y=13, height=14, width=5] Area is 70." Write a client program called Rectangle Client that creates objects of the Rectangle class called rect and rect2. Assign values to the fields of these objects. Print out these Rectangle objects using System.out.println() method. Please provide proper comments in the code. Comments are easy way to explain logic in short (Do not write comments more than 1 line) Problem 5A Write a C program to print your initials in block letters. Construct each block letter out of the letter it represents. An example follows: Student's name: Anteater, Peter J. Output of Peter's C program: AAAAAAAAA A A A A A A AAAAAAAAA PPPPPPPPPPPP JJ P P P P P JJJJJJJJJJJJJJ Write a Java class called Rectangle that represents a rectangular, two-dimensional region. In this lab you learn overriding a system method. Your Rectangle objects should have following methods: public void setFields(int newx, int newy, int newwidth, int newheight) Set the values for the fields in the Rectangle objects whose top-left corner is specified by the given x and y coordinates and by the width and height. public int getHeight() Returns the Rectangle's height. public int getWidth() Returns the Rectangle's width. public int getX() Returns the Rectangle's x-coordinate public int getY()) Returns the Rectangle's y-coordinate public String toString() Returns a String representation of this Rectangle, such as "Rectangle [x=2, y=13, height=14, width=5] Area is 70." Write a client program called Rectangle Client that creates objects of the Rectangle class called rect and rect2. Assign values to the fields of these objects. Print out these Rectangle objects using System.out.println() method. Please provide proper comments in the code. Comments are easy way to explain logic in short (Do not write comments more than 1 line)
Expert Answer:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these computer network questions
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
) Consider integer division of one two's-complement binary number by another. Programming languages may vary in the result when one argument is negative. What differing conventions might they be...
-
Given that log 10 (x 2 y) = 4 and log 10 (x 4 /y 3 ) = 18, find the value of log 10 x and of log 10 y.
-
Air is contained in a variable-load piston-cylinder device equipped with a paddle wheel. Initially, air is at 400 kPa and 17oC. The paddle wheel is now turned by an external electric motor until 75...
-
The beam shown in Figure P567 carries a repeated, reversed load of 400 N applied at section C. Compute the resulting design factor if the beam is made from SAE 1340 OQT 1300. Data in Figure P567. 12...
-
Four supervisors and 3 engineers are responsible for work at a construction site, and at least 2 supervisors and one engineer have to be present at all times. (a) Using two coordinates so that...
-
You are the IT director at Big Ten University. As part of a training program, you decide to draw a DM that includes some obvious mistakes to see whether your newly hired junior analysts can find...
-
The expected extra benefit of an additional gallon of gasoline to Norton and Egor is shown below. Gallons of Gas Extra benefit in dollars Norton Ed 1st 2.75 2.00 2nd 1.65 1.40 3rd 1.35 1.00 4th 1.10...
-
Elaborate on how Meadows presents the importance of thinking in systems, to make sense of the complex systems we live in . Why is this kind of thinking especially useful in a world that is vuca ?...
-
In England, the voir dire process is conducted by the trial judge and is extremely limited. Do you think the American system of criminal justice would have more credibility if the voir dire were...
-
Should a defendant always be permitted to view the contents of a presentence report? What are the arguments for and against this?
-
What means more to you, occasionally winning the championship or being competitive every year?
-
Suppose you were a probation officer and a judge asked you to recommend probation conditions for a first-time offender convicted of the sale and possession of cocaine. What specific conditions would...
-
Why would a Super Bowl at Ford Field in Detroit have more of an impact on Detroit than a regular season Detroit Lions game that draws the same number of fans?
-
The focus of this proposal is combating criminal narcotics activity along the southern border. Describes the development and design process for your program. Include the following in part iii of your...
-
1. Using the information from Problem 16-4B, prepare a statement of cash flows for Lim Garden Supplies Inc. using the direct method of presenting cash flows from operating activities. 2. How does Lim...
-
The end of a spring is pulled to the right by 4 cm; the restoring force is 8 N to the left. Given the relationships shown in Figure 8.14c, if the spring is returned to equilibrium and then pushed to...
-
Sketch a force acting at point \(\mathrm{P}\) in Figure Q8.2 that would make the rod be in static equilibrium. Is there only one such force? P - FIGURE Q8.2
-
A 10 kg mass is hung from a 1-m-long cable, causing the cable to stretch by 2 mm. Suppose a 10 kg mass is hung from a 2 m length of the same cable. By how much does the cable stretch? A. 0.5 mm B. l...
Study smarter with the SolutionInn App