Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I can't figure out why I am getting negative values for y in the output. Wrong output Correct output import java.util.Scanner public class Test public

I can't figure out why I am getting negative values for y in the output.

image text in transcribed

image text in transcribed

Wrong output

image text in transcribed

Correct output

image text in transcribed

import java.util.Scanner public class Test public static void main (String[] args) Scanner keyboard new Scanner(System.in); // this scanner is to prompt the user to input the integers necessary for the print lines of x //variables int xValue, starCount[ String star"; int [] starAmount; String [l starPoint; // this is being declared for the actual stars in for the graph output double increment, minimum // these doubles are accounting for the user input for the array values String pointOfStar.[; System.out.println("Please enter the number of x values to process"; xValue = keyboard.nextInt(); System.out.println("Enter a minimum value for x:" minimumkeyboard.nextDoubleO; System.out.println("Enter the amount to increment") increment- keyboard.nextDoub le); // following is code for for if x value is below one and will print out an error message if (xValue

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 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions