Placeholder

CMIS 141 Assignment 4 Output Triangle and Diamond Pattern

$19.00

Description

(1) Write Java code to prompts user for number of rows (e.g. 6) and output the triangle pattern below. Use nested for-loops.
(2) Write Java code to prompt user for side length (e.g. 6) and output diamond pattern below: Use nested for-loops.
Make sure your Java program is using the recommended style such as:
Javadoc comment up front with your name as author, date, and brief purpose of the
program
Comments for variables and blocks of code to describe major functionality
Meaningful variable names and prompts
Identifiers are written in upper CamelCase
Class name starts with upper case letter and variables in lower case letter
Constants are written in All Capitals
Use proper spacing and empty lines to make code human readable
Capture execution:
You should capture and label screen captures associated with compiling your code, and running a couple of different inputs for each program.
SCREENSHOTS
SOLUTION
PAYMENT
The solution consists of:
A report word document for this assignment
All Java programs in case you want to run theses programs on your computer.
Screenshots while running programs
Attachments [Move over files to preview content of those files]
CMIS_141_Assignment_4.zip (107.04 KB)
CMIS 141 Assignment 4 Report.docx
CMIS141-Assignment-4-Screenshot-1.png
CMIS141-Assignment-4-Screenshot-2.png
Source Code
PrintDiamond.java
PrintTriangle.java
Preview PrintDiamond.java
xxxxxx xxxxx xxxxxxxxxxxx {
xxxxxx xxxxxx xxxx xxxx(xxxxxx[] xxxx) {
xxx x, x;
int n = 6; int space = n – 1; for (j = 1; j <= n; j++) { for (i = 1; i <= space; i++) { System.out.print(" "); } xxxxx--; xxx (x = 1; x <= 2 * x - 1; x++) { xxxxxx.xxx.xxxxx("*"); } xxxxxx.xxx.xxxxxxx(""); } Preview PrintTriangle.java xxxxxx xxxxx xxxxxxxxxxxxx { xxxxxx xxxxxx xxxx xxxx(xxxxxx[] xxxx) { xxx x, x; // outer loop to handle number of rows for (i = 0; i < 6; i++) { // inner loop to handle number of columns // values changing acc. to outer loop for (j = 0; j <= i; j++) { // xxxxxxxx xxxxx xxxxxx.xxx.xxxxx("* "); } // xxxxxx xxxx xxxxx xxxx xxx xxxxxx.xxx.xxxxxxx(); Price: $19 You May Also Like: CMIS 141 Assignment 1 Student GPA CMIS 141 Assignment 2 Perform Operation on Two Numbers CMIS 141 Assignment 3 Calculate Student Grade CMIS 141 Assignment 5 Body Mass Index CMIS 141 Assignment 6 Highest and Lowest Score CMIS 141 Final Project Employee Salary

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.