Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Lv 181 points

Tyman23

Favorite Answers27%
Answers58
  • Will there be a Madoka Magica Season 2 (Or some other continuation)?

    I know the series could end with the 3rd movie Rebellion but was wondering if there are any plans to continue the series. Any concrete evidence would be greatly appreciated.

    2 AnswersComics & Animation7 years ago
  • Need help with making a histogram in java?

    Here is the problem. You are a professor teaching a class. It is the end of the semester and you wish to see how your students performed, so you write a Java program that will create a histogram of the

    grade distribution. You want this histogram program to be able to give you a very detailed view or

    a very broad view of the grade distribution. To accomplish this, it asks the user how many bins the

    grades should be split into. I'm provided with a grade text file that has one integer number per line representing a student’s grade in the class. These numbers are not sorted but they are bound between 0 and 100(inclusive). Using an array, you must count the frequency of each grade value and print it to the standard output as a horizontal histogram. You must also label the range of each histogram bar and allow the user to indicate what size interval they would like the histogram to be made with.

    Here's my code so far.

    import java.io.File;

    import java.util.Scanner;

    public class GradeHistogram {

    public static void main(String[] args) throws Exception {

    Scanner scanner = new Scanner(new File(args[0]));

    System.out.println("Grades loaded!");

    System.out.println("What bucket size would you like?");

    scanner = new Scanner(System.in);

    int bucketSize = scanner.nextInt();

    for (int i = 101; i >= 0; i = i - bucketSize) {

    //print Histogram;

    }

    }

    }

    Example printouts.

    java GradeHistogram grades.txt

    Grades loaded!

    What bucket size would you like?

    >>> 10

    100 - 91 | [][][][][][][][][][][][]

    90 - 81 | [][][][][][][][][][][][][][][][][][][][][][][][][][]

    80 - 71 | [][][][][][][][][][][][][][]

    70 - 61 | [][][][][][][][][][][][][][][][][]

    60 - 51 | [][][][][][][]

    50 - 41 | [][][][]

    40 - 31 | [][][][][][]

    30 - 21 | [][]

    20 - 11 |

    10 - 1 | []

    0 - 0 |

    java GradeHistogram grades.txt

    Grades loaded!

    What bucket size would you like?

    >>> 5

    100 - 96 | [][][][][][]

    95 - 91 | [][][][][][]

    90 - 86 | [][][][][][][][][][][][][][][][][]

    85 - 81 | [][][][][][][][][]

    80 - 76 | [][][][][][][][][][][][]

    75 - 71 | [][]

    70 - 66 | [][][][][][][][][][]

    65 - 61 | [][][][][][][]

    60 - 56 | [][][][][]

    55 - 51 | [][]

    50 - 46 | [][][]

    45 - 41 | []

    40 - 36 | [][][]

    35 - 31 | [][][]

    30 - 26 | []

    25 - 21 | []

    20 - 16 |

    15 - 11 |

    10 - 6 | []

    5 - 1 |

    0 - 0 |

    My problem is how to make the grade.txt file into an array and how to make that into a histogram.

  • Need some help with this Java Program?

    Write a Java class that is executable from the command line named LineFilter. LineFilter

    should read lines from stdin (System.in) and print to stdout (System.out) any line that

    contains the text given in the first command line argument. If no command line argument is

    given, it should print every line.

    When you run your program it should give no prompt and wait for the user to enter a line of text

    and hit enter. If you give no command line arguments when you run your program it should simply

    echo the user’s input on the next line, then wait for the user to enter another line. You can stop the

    program by entering Ctrl-D. Ctrl-D signals to the terminal that the input stream will produce no

    more data, and will cause Scanner’s hasNext method to return false.

    When you run your program with a command line argument, it only echoes the user’s input if it

    contains the text in the command line argument.

    My code compiles, but throws an exception at line 9 when I run it. Any suggestions?

    import java.util.Scanner;

    import java.lang.String;

    public class LineFilter {

    public static void main(String[] args) {

    Scanner keyboard = new Scanner(System.in);

    String newLine = keyboard.next();

    if (newLine == "") {

    while (keyboard.hasNext()) {

    System.out.println(keyboard.next()); }

    } else {

    while (keyboard.hasNext()) {

    String nextLine = keyboard.next();

    if (nextLine.contains(args[0])) {

    System.out.println(newLine);

    }

    }

    }

    }

    }

    1 AnswerProgramming & Design7 years ago
  • Need some help with this java code?

    The class should read lines from stdin (System.in) and print to stdout (System.out) any line that

    contains the text given in the first command line argument. If no command line argument is

    given, it should print every line. I'm trying to figure out how to compare the user's input(search term) to stdin. What am I doing wrong?

    import java.util.Scanner;

    import java.lang.String;

    public class LineFilter {

    public static void main(String[] args) {

    Scanner keyboard = new Scanner(System.in);

    String newLine = keyboard.next();

    if (keyboard == "") {

    while (keyboard.hasNext()) {

    System.out.println(System.in); }

    } else {

    while (keyboard.hasNext()) {

    if (newLine.contains(System.in) {

    System.out.println(keyboard.nextLine());

    }

    }

    }

    }

    }

    3 AnswersProgramming & Design7 years ago
  • I just started playing final fantasy VII on my ps vita and don't know how to save my game?

    When I bring up the menu there is a save option but for whatever reason it won't let my save the game. Do I need to make a memory card on my ps vita? If so, how do I do that?

    2 AnswersVideo & Online Games8 years ago
  • Can I get some help with this java code?

    This is the assignment. Write a method named threeHeads that repeatedly flips a coin until three heads in a row are seen. You should use a Random object to give an equal chance to a head or a tail appearing. Each time the coin is flipped, what is seen is displayed (H for heads, T for tails). When 3 heads in a row are flipped a congratulatory message is printed. Here are possible outputs of two calls to threeHeads:

    T T T H T H H H

    Three heads in a row!

    (Because this problem uses random numbers, our test cases check only the general format of your output. You must still examine the output yourself to make sure the answer is correct.)

    Here is my code.

    import acm.program.*;

    import acm.util.*;

    public void run() {

    System.out.println("This program flips a coin until there are three" +

    "heads in the row.");

    while(!TryFlipThreeHeads()) {

    }

    System.out.println("Yupii! There are already three same heads in the row :)");

    }

    I get one error when trying to compile the code.

    Line 6

    You are referring to an identifer (a name of a variable, class, method, etc.) that is not recognized. Perhaps you misspelled it, mis-capitalized it, or forgot to declare it?

    cannot find symbol

    symbol : method TryFlipThreeHeads()

    while(!TryFlipThreeHeads()) {

    ^

    1 error

    Any suggestions for how to fix the code?

    2 AnswersProgramming & Design8 years ago
  • Can I get some help with this java code?

    This is the assignment. Write a method named toBinary that accepts an integer as a parameter and returns a string of that number's representation in binary. For example, the call of toBinary(42) should return "101010".

    This is my code.

    public static String toBinary(int n)

    {

    if(n<0)

    {

    return ("-"+toBinary(0-n));

    }

    String t="";

    while(n>0)

    {

    t=""+(n&1)+t;

    n/=2;

    }

    return t;

    }

    The code runs fine except when it tests 0 it returns "" when it should return 0. I already tried changing while (n>0) to while (n>=0) and it doesn't work. Any suggestions?

    1 AnswerProgramming & Design8 years ago
  • Can I get some help with this java code?

    This is the assignment. Write a method named gcd that accepts two integers as parameters and returns the greatest common divisor of the two numbers. The greatest common divisor (GCD) of two integers a and b is the largest integer that is a factor of both a and b. The GCD of any number and 1 is 1, and the GCD of any number and 0 is that number.

    One efficient way to compute the GCD of two numbers is to use Euclid's algorithm, which states the following:

    GCD(A, B) = GCD(B, A % B)

    GCD(A, 0) = Absolute value of A

    In other words, if you repeatedly mod A by B and then swap the two values, eventually B will store 0 and A will store the greatest common divisor.

    For example: gcd(24, 84) returns 12, gcd(105, 45) returns 15, and gcd(0, 8) returns 8.

    Here is my code.

    public static int gcd(int a, int b) {

    if (b == 0) {

    return a;

    }

    else

    {

    return gcd(b, a%b);

    }

    }

    The code runs fine except for when it tests two negative integers. For example(-512, -12) it says the gcd is -4 when the gcd is 4. Any suggestions?

    2 AnswersProgramming & Design8 years ago
  • Can I get some help with this java code?

    This is the assignment. Write a method named threeHeads that repeatedly flips a coin until three heads in a row are seen. You should use a Random object to give an equal chance to a head or a tail appearing. Each time the coin is flipped, what is seen is displayed (H for heads, T for tails). When 3 heads in a row are flipped a congratulatory message is printed.

    This is my code. import acm.program.*;

    import acm.util.*;

    public void run() {

    system.out.println("This program flips a coin until there are three" +

    "heads in the row.");

    while(!TryFlipThreeHeads()) {

    }

    system.out.println("Yupii! There are already three same heads in the row :)");

    }

    When I try to compile it says I have these errors.

    Line 4

    package system does not exist

    package system does not exist

    system.out.println("This program flips a coin until there are three" +

    ^

    Line 6

    You are referring to an identifer (a name of a variable, class, method, etc.) that is not recognized. Perhaps you misspelled it, mis-capitalized it, or forgot to declare it?

    cannot find symbol

    symbol : method TryFlipThreeHeads()

    while(!TryFlipThreeHeads()) {

    ^

    Line 8

    package system does not exist

    package system does not exist

    system.out.println("Yupii! There are already three same heads in the row :)");

    ^

    3 errors

    2 AnswersProgramming & Design8 years ago
  • Can I get some help with this java code?

    This is the assignment. Write a method named printFactors that accepts an integer as its parameter and uses a fencepost loop to print the factors of that number, separated by the word " and ". For example, the number 24's factors should print as:

    1 and 2 and 3 and 4 and 6 and 8 and 12 and 24

    You may assume that the number parameter's value is greater than 0.

    This is my code.

    for (int k; k <= number; k++) {

    if (number % k == 0) {

    System.out.print(k);

    }

    if (k != number) {

    System.out.print(" and");

    }

    }

    I have all of these errors when trying to compile the code.

    Line 1

    You have an illegal description of a data type here. Sometimes this happens when you misuse the syntax for generic types.

    illegal start of type

    for (int k; k <= number; k++) {

    ^

    Line 1

    You may have forgotten to include a ) right-parenthesis to match an opening ( left-parenthesis earlier in the code.

    ')' expected

    for (int k; k <= number; k++) {

    ^

    Line 1

    You may have forgotten to type an identifier here, such as a variable's name or type.

    <identifier> expected

    for (int k; k <= number; k++) {

    ^

    Line 1

    You may have forgotten to type an identifier here, such as a variable's name or type.

    <identifier> expected

    for (int k; k <= number; k++) {

    ^

    Line 1

    You may have forgotten to type an identifier here, such as a variable's name or type.

    <identifier> expected

    for (int k; k <= number; k++) {

    ^

    Line 1

    You have an illegal description of a data type here. Sometimes this happens when you misuse the syntax for generic types.

    illegal start of type

    for (int k; k <= number; k++) {

    ^

    Line 1

    You may have forgotten to type an identifier here, such as a variable's name or type.

    <identifier> expected

    for (int k; k <= number; k++) {

    ^

    Line 1

    You may have forgotten to end a statement with a semicolon. Each Java statement must end with a semicolon.

    ';' expected

    for (int k; k <= number; k++) {

    ^

    Line 2

    You have an illegal description of a data type here. Sometimes this happens when you misuse the syntax for generic types.

    illegal start of type

    if (number % k == 0) {

    ^

    Line 2

    You may have forgotten to end a statement with a semicolon. Each Java statement must end with a semicolon.

    ';' expected

    if (number % k == 0) {

    ^

    Line 2

    You may have forgotten to type an identifier here, such as a variable's name or type.

    <identifier> expected

    if (number % k == 0) {

    ^

    Line 2

    You have an illegal description of a data type here. Sometimes this happens when you misuse the syntax for generic types.

    illegal start of type

    if (number % k == 0) {

    ^

    Line 2

    You may have forgotten to type an identifier here, such as a variable's name or type.

    <identifier> expected

    if (number % k == 0) {

    ^

    Line 2

    You may have forgotten to end a statement with a semicolon. Each Java statement must end with a semicolon.

    ';' expected

    if (number % k == 0) {

    ^

    Line 3

    You may have forgotten to type an identifier here, such as a variable's name or type.

    <identifier> expected

    System.out.print(k);

    ^

    Line 3

    You may have forgotten to type an identifier here, such as a variable's name or type.

    <identifier> expected

    System.out.print(k);

    ^

    Line 5

    class, interface, or enum expected

    class, interface, or enum expected

    if (k != number) {

    ^

    Line 7

    class, interface, or enum expected

    class, interface, or enum expected

    }

    ^

    18 errors

    Can I get a revised version of the code that will run properly?

    4 AnswersProgramming & Design8 years ago
  • Can I get some help with this java code?

    This is the assignment. Write a method named toBinary that accepts an integer as a parameter and returns a string of that number's representation in binary.

    Here is my code.

    public static String toBinary(int n)

    {

    if(n<0)

    {

    return ("-"+toBinary(0-n));

    }

    String t="";

    while(n>0)

    {

    t=""+(n&1)+t;

    n/=2;

    }

    return t;

    }

    The code runs correctly for most tests but when I plug in 0 to the code it returns "" instead of 0.

    2 AnswersProgramming & Design8 years ago
  • Can I get some help with this java code?

    This is the assignment. Write a method named gcd that accepts two integers as parameters and returns the greatest common divisor of the two numbers. The greatest common divisor (GCD) of two integers a and b is the largest integer that is a factor of both a and b. The GCD of any number and 1 is 1, and the GCD of any number and 0 is that number.

    Here is my code.

    public static int gcd(int a, int b) {

    if (b == 0) {

    return a;

    }

    else {

    return gcd(b, a%b);

    }

    }

    The problem is whenever I have two negative integers it returns a negative integer as gcd instead of a positive integer. For example with (-512, -12) it says that the gcd is -4 and not 4 like it should.

    3 AnswersProgramming & Design8 years ago
  • Can you tell me the order of these events in Hamlet?

    -Laertes is slain

    -Hamlet fails to kill the king thinking him to be in prayer

    -The play, "Murder of Gonzago," is performed

    -The Ghost directs Hamlet to avenge his father's death

    -Claudius and Laertes plot to kill Hamlet

    -Claudius decides to send Hamlet to England

    -Hamlet slays Polonius

    -Horatio receives a letter telling of Hamlet's escape from the ship

    -Hamlet tells Ophelia that he never loved her

    -Ophelia drowns

    1 AnswerHomework Help9 years ago
  • Can I get some help with this Quadratic class in Java?

    public class QuadraticRunner

    {

    public static void main(String[]args)

    {

    }

    public double Quadratic(double x, double y, double z) {

    double a = x;

    double b = y;

    double c = z;

    }

    public double getDiscriminant()

    {

    return Math.sqrt(b*b)-(a*c);

    }

    public double getSolutions()

    {

    if(Math.sqrt(b*b)-(a*c)<0)

    {

    return "there are no real solutions";

    }

    else

    {

    if(Math.sqrt(b*b)-(a*c)==0)

    {

    return (-b+Math.sqrt((b*b)-(a*c)/2));

    }

    else

    {

    if(Math.sqrt((b*b)-(a*c)>0)

    {

    return ((-b+Math.sqrt(b*b)-(a*c)/2) && (-b-Math.sqrt(b*b)-(a*c)/2);

    }

    }

    }

    }

    }

    This is the assignment. Write a program that prints all real solutions to the quadratic equation, ax2+bx+c=0. Read in a, b, c and use the quadratic formula.

    If the discriminant, b2-4ac, is negative, display a message stating that there are no real solutions.

    I'm having some trouble with the constructor for the class and when I try to compile the code I get errors. Any suggestions on what I should change so that the code can run properly would be greatly appreciated.

    The errors that come up when I try to compile the code.

    7 errors found:

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 6]

    Error: This method must return a result of type double

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 13]

    Error: b cannot be resolved to a variable

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 13]

    Error: b cannot be resolved to a variable

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 13]

    Error: a cannot be resolved to a variable

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 13]

    Error: c cannot be resolved to a variable

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 29]

    Error: Syntax error, insert ") Statement" to complete BlockStatements

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 31]

    Error: Syntax error, insert ")" to complete Expression

    2 AnswersProgramming & Design9 years ago
  • Can I get some help with this Quadratic class in Java?

    public class QuadraticRunner

    {

    public static void main(String[]args)

    {

    public Quadratic(double x, double y, double z) {

    a = x;

    b = y;

    c = z;

    }

    public double getDiscriminant()

    {

    return Math.sqrt(b*b)-(a*c));

    }

    public double getSolutions()

    {

    if(Math.sqrt(b*b)-(a*c)<0))

    {

    return "there are no real solutions";

    }

    else

    {

    if(Math.sqrt(b*b)-(a*c)==0))

    {

    return (-b+Math.sqrt((b*b)-(a*c)/2));

    }

    else

    {

    if(Math.sqrt((b*b)-(a*c)>0))

    {

    return ((-b+Math.sqrt(b*b)-(a*c)/2) && (-b-Math.sqrt(b*b)-(a*c)/2));

    }

    }

    }

    }

    }

    This is the assignment. Write a program that prints all real solutions to the quadratic equation, ax2+bx+c=0. Read in a, b, c and use the quadratic formula.

    If the discriminant, b2-4ac, is negative, display a message stating that there are no real solutions.

    I get these errors when trying to compile the data.

    8 errors found:

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 4]

    Error: Syntax error, insert "}" to complete MethodBody

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 5]

    Error: Return type for the method is missing

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 6]

    Error: a cannot be resolved to a variable

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 7]

    Error: b cannot be resolved to a variable

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 8]

    Error: c cannot be resolved to a variable

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 12]

    Error: Syntax error on token ")", delete this token

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 16]

    Error: Syntax error on token ")", delete this token

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 22]

    Error: Syntax error on token ")", delete this token

    2 AnswersProgramming & Design9 years ago
  • Can I get some help with this logic problem in Java?

    public class Quadratic

    {

    public static void main(String[]args)

    {

    public Quadratic(double x, double y, double z) {

    a = x;

    b = y;

    c = z;

    }

    public getDiscriminant()

    {

    return Math.sqrt(b*b)-(a*c));

    }

    public getSolutions()

    {

    if(Math.sqrt(b*b)-(a*c)<0))

    {

    return "there are no real solutions";

    }

    else

    {

    if(Math.sqrt(b*b)-(a*c)==0))

    {

    return (-b+Math.sqrt((b*b)-(a*c)/2));

    }

    else

    {

    if(Math.sqrt((b*b)-(a*c)>0))

    {

    return ((-b+Math.sqrt(b*b)-(a*c)/2) && (-b-Math.sqrt(b*b)-(a*c)/2))

    }

    }

    }

    }

    }

    This is the assignment. Write a program that prints all real solutions to the quadratic equation, ax2+bx+c=0. Read in a, b, c and use the quadratic formula.

    If the discriminant, b2-4ac, is negative, display a message stating that there are no real solutions.

    When I try to compile the code I get errors.

    11 errors found:

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 1]

    Error: The public type Quadratic must be defined in its own file

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 4]

    Error: Syntax error, insert "}" to complete MethodBody

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 6]

    Error: a cannot be resolved to a variable

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 7]

    Error: b cannot be resolved to a variable

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 8]

    Error: c cannot be resolved to a variable

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 10]

    Error: Return type for the method is missing

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 12]

    Error: Syntax error on token ")", delete this token

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 14]

    Error: Return type for the method is missing

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 16]

    Error: Syntax error on token ")", delete this token

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 22]

    Error: Syntax error on token ")", delete this token

    File: C:\Users\alienware\Desktop\AP CS\QuadraticRunner.java [line: 30]

    Error: Syntax error, insert ";" to complete BlockStatements

    2 AnswersProgramming & Design9 years ago
  • Can I get some help with this logic problem in Java?

    public class QuadraticRunner

    {

    public static void main(String[]args)

    {

    Quadratic blue = new Quadratic(1.0,2.0,3.0);

    boolean isTrue = blue.hasSolutions();

    if(isTrue==true)

    {

    double one = blue.getSolution1();

    double two = blue.getSolution2();

    System.out.println("The first solution is " + one);

    System.out.print("the real solutions to this quadratic are" + one + " and " + two);

    System.out.println("The second solution is " + two);

    }

    else

    {

    System.out.print("there are no real solutions");

    }

    }

    }

    This is the assignment. Write a program that prints all real solutions to the quadratic equation, ax2+bx+c=0. Read in a, b, c and use the quadratic formula.

    If the discriminant, b2-4ac, is negative, display a message stating that there are no real solutions. Submit your Java file to the "Quadratic Class Quiz" Dropbox.

    Also, when I try to compile the code it says,"Quadratic cannot be resolved to a type [line 5]"

    2 AnswersProgramming & Design9 years ago
  • Can I get some help with this logic problem in Java?

    public class QuadraticRunner

    {

    public static void main(String[]args)

    {

    Quadratic blue = new Quadratic(1.0,2.0,3.0);

    boolean isTrue = blue.hasSolutions();

    if(isTrue==true)

    {

    double one = blue.getSolution1();

    double two = blue.getSolution2();

    System.out.println("The first solution is " + one);

    System.out.print("the real solutions to this quadratic are" + one + " and " + two);

    System.out.println("The second solution is " + two);

    }

    else

    {

    System.out.print("there are no real solutions");

    }

    }

    }

    This is the assignment. Write a program that prints all real solutions to the quadratic equation, ax2+bx+c=0. Read in a, b, c and use the quadratic formula.

    If the discriminant, b2-4ac, is negative, display a message stating that there are no real solutions. Submit your Java file to the "Quadratic Class Quiz" Dropbox.

    Also, when I try to compile the code it says,"Quadratic cannot be resolved to a type [line 5]"

    3 AnswersProgramming & Design9 years ago
  • Can I get some help with this Quadratic class in Java?

    public class QuadraticRunner

    {

    public static void main(String[]args)

    {

    Quadratic blue = new Quadratic(1.0,2.0,3.0);

    boolean isTrue = blue.hasSolutions();

    if(isTrue==true)

    {

    double one = blue.getSolution1();

    double two = blue.getSolution2();

    System.out.println("The first solution is " + one);

    System.out.print("the real solutions to this quadratic are" + one + " and " + two);

    System.out.println("The second solution is " + two);

    }

    else

    {

    System.out.print("there are no real solutions");

    }

    }

    }

    This is the assignment. Write a program that prints all real solutions to the quadratic equation, ax2+bx+c=0. Read in a, b, c and use the quadratic formula.

    If the discriminant, b2-4ac, is negative, display a message stating that there are no real solutions. Submit your Java file to the "Quadratic Class Quiz" Dropbox.

    Also, when I try to compile the code it says,"Quadratic cannot be resolved to a type [line 5]"

    2 AnswersProgramming & Design9 years ago