Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

write a main method that computes the sum of the numbers from 99 to 350 using an increment of 7. Print that sum with a

write a main method that computes the sum of the numbers from 99 to 350 using an increment of 7. Print that sum with a message. (Do this programmatically,, not one long addition string)

3. Run the main method (run class Asg1Part1). Check that the output is correct.

4. Inside of class Asg1Part1, add additional code to the main method to ALSO sum the numbers from 2500 to 3500 that are evenly divisible by 23. Print that sum with a message. 5. Run the class Asg1Part1 (main method in that class). Check that the output is correct.

6. Add more code to the main method in class Asg1Part1, to compute the "sum of the squares" of all the numbers from 7 to 67, i.e.7*7 + 8*8 + 9*9... +67*57. Print the sum with a message.

7. Run the main method for Asg1Part1. Capture the console output. (Now output should include all the sums from previous parts.)

8. Put the program code (from class Asg1Part1) and console output of final run with all added code at the end of your text file,

. Part 2 1. In the package asg1, create a new class named WordGame.

2. Write a program that plays a word game with the user. The program should ask the user to enter the following: A boy name An age The name of a city A girl name The name of a country A food or dish A type of animal

3. After the user has entered these items, the program should display the following story, inserting the users input into the appropriate locations: There once was this boy named BOYNAME. He was AGE years old. His family resides in the special town of CITY. One day, BOYNAME met this amazing girl named GIRLNAME. It was always a dream of BOYNAME's to take GIRLNAME to COUNTRY. He would cook GIRLNAME his favorite dish, FOOD and after dinner they would ride ANIMAL into the sunset.

4. Prompts And Output Labels: There are no labels here but the prompts should simply be (respectively) "Enter a boy's name: ", "Enter an age: ", "Enter the name of a city: ", "Enter a girl's name: ", "Enter country: ", "Enter a type of animal: ". Note that each prompt ends with a ":" followed by one space and is displayed so that the response will appear on the same line as the prompt itself.

5. Input: Keep in mind that the input responses to the prompts may consist of multiple words. For example, name might be "Joseph Gordon-Levitt".

6. CLASS NAMES. Your program class should be called WordGame 7. Identify three sets of inputs. Run all three sets. dont know where to start here, please include screenshots of how the code should look etc.

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

DB2 Universal Database V7.1 Application Development Certification Guide

Authors: Steve Sanyal, David Martineau, Kevin Gashyna, Michael Kyprianou

1st Edition

0130913677, 978-0130913678

More Books

Students also viewed these Databases questions

Question

Describe who reads a business plan and what they are looking for.

Answered: 1 week ago

Question

Explain all drawbacks of application procedure.

Answered: 1 week ago