Java program by array

Assignment Help JAVA Programming
Reference no: EM13213635

Write a java program by array:
It would be nice to display images by some means other than printing out integers. Ideally, your program should read and write images using standard image formats. But actual image formats, like giff, tiff, and jpeg are very complicated. Instead, write a program that displays an image by using rows of characters to represent brightness levels. 

Write a program that reads in a file that contains one integer per line. Each integer represents one location in the image. Assume that there are 64 rows and 64 columns in the image. Assume that the integers are in the range 0 to 63. 

For each integer, write out a single character depending on its value: 

· 0 to 7: space 

· 8 to 15: . 

· 16 to 23: , 

· 24 to 31: - 

· 32 to 39: + 

· 40 to 47: o 

· 48 to 55: O 

· above 55: X 

Don't put extra spaces between characters. Start a new line after each row of 128 characters. This is one place where the switch statement is convenient. To use it, divide the input value by 8 to get the integer for the switch. Or you can use eight if-else statements if you prefer. 

Reference no: EM13213635

Questions Cloud

State what is the final pressure of the whole system in atm : Three bulbs are connected by tubing, and the tubing is evacuated. The volume of the tubing is 32.0 mL. The first bulb has a volume of 35.0 mL and contains 3.00 atm of argon, the second bulb has a volume of 250 mL and contains 2.27 atm of neon
Compute the molar mass of the unknown gas : From the same container under the same conditions--same temperature and initial pressure, it takes 40 s for 1.00 L of O2 gas to effuse. Calculate the molar mass (in grams/mol) of the unknown gas.
Explain the original pressure of argon in the cylinder : If the pressure in the cylinder is 5.28 atm after the neon is added, what was the original pressure (in atm) of argon in the cylinder?
Painful divorce : While Professor Gomez was going through a painful divorce, he tended to create unnecessarily difficult tests and gave his students unusually low grades. A psychoanalyst would be most likely to view the professor's treatment of students as an example ..
Java program by array : Write a program that reads in a file that contains one integer per line. Each integer represents one location in the image. Assume that there are 64 rows and 64 columns in the image
Explain what is the partial pressure of argon : What is the partial pressure of argon, in torr, in a container that also contains neon at 147 torr and is at a total pressure of 536 torr?
Explain what mass of water in grams forms from the reaction : What mass of water (in grams) forms from the reaction of 2.58 L of hydrogen gas and 2.26 L of oxygen gas?
Why was the annexation of texas so controversial : Why was the annexation of Texas so controversial? What conditions gave rise to the early women's rights movement?
Reaction of magnesium metal with hcl yields hydrogen gas : The reaction of magnesium metal with HCl yields hydrogen gas and magnesium chloride. What is the volume, in liters, of the gas formed at 736 torr and 18 oC from 4.49 g of Mg in excess HCl?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Determine if strings are equal

Complete the recursive method match in the code below which will determine whether or not two strings match.

  Method splitstack that takes a stack

Write a method splitStack that takes a stack of integers as a parameter and splits it into negatives and non-negatives. The numbers in the stack should be rearranged so that all the negatives appear on the bottom of the stack and all the non-negat..

  The program should ask the user to enter the student'' answer

Your program should store these correct answers in an array. (Store each question's correct answer in an element of a string array.) the program should ask the user to enter the student's answers for each of the 20 questions, which should be stored i..

  Writing a program that parses

The programming project involves writing a program that parses, using recursive descent, a GUI definition language defined in an input file and generates the GUI that it defines.

  Reads in up to 1000 non-negative integers

Write a program that reads in up to 1000 non-negative integers and displays distinct numbers (i.e., if a number appears multiple times, it is displayed only once). (Hint: Read each number and store it in an array if it is new. If the number is alread..

  Create an employee class.

Create an Employee class. Items to include as data members are employee number, name, date of hire, job description, department, and monthly salary.

  Write a java program that accepts a positive long integer

Write a Java program that accepts a positive long integer between 2 to 15, and then using the number, calculate its factorial (n!). Using do-while statement, make sure it only accepts a valid number (between 2 and 15) - if an invalid number is ent..

  Create a book class for the library application project

Create a Book class for the Library application project. In addition to properties of author and isbn, with setters/getters, the Book should override Object's base method "boolean equals(Object)" and have a "boolean validate()" method.

  Compilation and Execution - JAVA problem

Style marks are based on how your submitted code looks. Remember that good code is easily readable (and understandable) by someone who did not write it. For assignments, you should also include your name, student number, what course this is, what ass..

  What is server-side and client-side scripting?

1. What is Server-side and Client-side scripting? Explain the differences between server-side and client - side scripting languages. Please provide 3 advantages and disadvantages of each. Please provide applicable references in APA style

  Write a while loop that lets the user enter a number

1) Write a while loop that lets the user enter a number. The number should then be multiplied by 10, and stored in a variable called product. The loop should then iterate as long as product contains a value less than 100.

  Ask the user to input a grade (integer from 1-100)

Program should still ask the user to input a grade (integer from 1-100) and then output the letter grade.  Scale:  Greater than 90 is an "A"; Greater than 80 to 90 is a "B", Greater than 70 to 80 is a "C", Greater than 60 to 70 is a "D", and 60 or le..

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