A Part1 ITF106 PR WK 02.docx - ITF106 PR-WK-02 ACTIVITY...

• 13

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 - 4 out of 13 pages.

ITF106 PR-WK-02ACTIVITYName:Ralph CustodioCourse/year & section:BSIT 1AA PART 1.1. Write a program that will print your initials to standard output in letters that are nine lines tall. Eachbig letter should be made up of a bunch of *'s. For example, if your initials were "DJE", then the outputwould look something like:********************************************************************************************************************Solution:I created this program by using only the print command (System.out.println), to print or displaymy pre-formatted initials (RDC) in big letters made up ofa bunch of *’s. First, I created the pre-formatted initials in notepad and then I copy it line by line, and then I created a program that will printsevery line.Click here for my Source Code for problem 1.Code
Output
2. Write a program that simulates rolling a pair of dice. You can simulate rolling one die by choosingone of the integers 1, 2, 3, 4, 5, or 6 at random. The number you pick represents the number on the dieafter it is rolled. As pointed out in Section 2.5, the expression(int)(Math.random()*6) + 1does the computation to select a random integer between 1 and 6. You can assign this value to avariable to represent one of the dice that are being rolled. Do this twice and add the results together toget the total roll. Your program should report the number showing on each die as well as the total roll.For example:The first die comes up 3The second die comes up 5Your total roll is 8ofand

Course Hero member to access this document

Course Hero member to access this document

End of preview. Want to read all 13 pages?

Course Hero member to access this document

Term
Spring
Professor
Ms.Gemma Valdez
Tags
Letter case, Dozen