Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1) create a method which generates random numbers. the method takes an int parameter indicating how many random numbers to print. Use a loop. Setup:

image text in transcribed

1) create a method which generates random numbers. the method takes an int parameter indicating how many random numbers to print. Use a loop.

Setup: In eclipse create a new java program called CS131JavaTest. Create a class containing a main method called Tester.java. Invoke (call) each of the methods below from your main method 1) Create a method which generates random numbers. The method takes an int parameter indicating how many random numbers to print. Use a loop. 2) Create a method which takes two int parameters and swaps them. Print the values before and after swapping. (Example:"before swap: x-5, y : 10; after swap: x-10, y:5) 3a) Create a constant out of the following string: "today is a very fine day to be in Fairfield" 3b) Create a method that uses the constant as follows: For each word in the constant, if the word has an odd number of letters, print the word in upper case If the word has an even number of letters, print the word in lower case o Keep a count of how many words contain the letter 'y and print that result. hint: break down the string to a series of words o o 4) Write a method to get a value from the user and convert that value from Fahrenheit to Celsius: For Celsius to Fahrenheit conversion use: T 9*T/5 32 Print the result of the conversion 5) A word is said to be a doubloon if every letter that appears in the word appears exactly twice. Here are some example doubloons found in the dictionary: appeases, arraigning, beriberi, bilabial, Caucasus, coco, Dada, deed, Emmett, Hannah Write a method called isDoubloon that takes a string parameter, checks whether it is a doubloon, and returns a Boolean result. Return the result to your main method and print the result

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

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions

Question

4. Did the presenter offer a clear and memorable summary?

Answered: 1 week ago