Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

input double and if errors

$
0
0
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package fastfood;

import java.util.Scanner;

/**
 *
 * @author RAZER08
 */
public class FastFood {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        System.out.println("rakkStar Fast Food and Restaurant");
        
        
        double foodclass;
        double food;
        
        Scanner in = new Scanner (System.in);
        
        System.out.println("");
        System.out.println("Please Choose Product");
        System.out.println("(1)   Burger                    25.00 ");
        System.out.println("(2)   Spaghetti                 35.00 ");
        System.out.println("(3)   Fried Chicken /w Rice     30.00");
        
        foodclass = input.Double();
        
        if (selection==1) {
            System.out.println("You have purchased Burger for 25.00");
        }
       
       
        
      
        
        
    }
}



run:
rakkStar Fast Food and Restaurant

Please Choose Product
(1)   Burger                    25.00 
(2)   Spaghetti                 35.00 
(3)   Fried Chicken /w Rice     30.00
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - Erroneous sym type: input.Double
	at fastfood.FastFood.main(FastFood.java:33)
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)



Please help me fill the missing parts and correct the wrong ones.
I just started to learn java :)
THANKS !

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>