简体   繁体   English

我似乎无法弄清楚接下来要做什么。 它一直说“不是声明”

[英]I can't seem to figure out what to do next. It keeps saying “Not a statement”

I was given a set of code to debug and I have it all debugged except for one last line that keeps telling me that it is "Not a statement" and I am just confused about what to do next.我得到了一组要调试的代码,除了最后一行一直告诉我它是“不是声明”之外,我已经调试了所有代码,我只是对下一步要做什么感到困惑。 If anyone can help me here it would be much appreciated.如果有人能在这里帮助我,我将不胜感激。

Screenshot of error message错误信息截图

Here is also the code that is in the picture.这也是图片中的代码。

// This program calculates the sale price of an
// item that is regularly priced at $59, with
// a 20 percent discount subtracted.

import java.util.Scanner;  // Needed for the Scanner class

public class Discount
{
   public void main(String[] args)
   {
      Variables to; hold the; regular price, the;
      amount of; a discount, and; the sale; price;
      double regularPrice = 59.0;
      double salePrice;
      
      // Create a Scanner object to read input
      scanner keyboard = new Scanner(System.input);
      
      // Get the regular price
      System.out.print("Enter regular price");
      regularPrice = key.next();
      
      // Calculate the amount of a 20% discount.
      discount = regularPrice * 0.20;
      
      // Calculate the sale price by subtracting
      // the discount from the regular price.
      salePrice = regularPrice - discount;
      
      // Display the results.
      system.println("Regular price: $ + regularprice");
      system.println("Discount amount: $ + discount");
      system.println("Sale price: $ + total");
   
}
}

Comment these two lines:注释这两行:

Variables to; hold the; regular price, the;
amount of; a discount, and; the sale; price;

They have to be comments.他们必须是评论。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我似乎无法弄清楚如何处理此实例,以便我的代码可以打印出要求 - I can't seem to figure out what to do with this instance so that my code could print out the requirement Java做while循环不断重复,我不知道为什么 - java do while loop keeps repeating and I can't figure out why 我不知道为什么我的if语句有效 - I can't figure out why my if statement is working 我似乎无法弄清楚如何打印所有包括重复的单词 - I can't seem to figure out how to get this print out all the words including the duplicates 您好,我似乎无法弄清楚为什么我的程序无法正常工作 - Hello I can't seem to figure out why my program isn't working 我一直在试图弄清楚如何纠正这个错误,但我似乎无处可去 - I've been trying to figure out how to correct this error and i can't seem to be getting anywhere 编译Java程序时遇到问题,我是新手。 无法弄清楚如何处理目录 - Having trouble compiling a Java program, I am new to it. Can't figure out what to do with directories 在第 16 行从二维数组输入中获取 InputMismatchException 并且我似乎无法弄清楚为什么 - Getting An InputMismatchException On Line 16 From A 2D Array Input And I Can't Seem To Figure Out Why 我似乎无法弄清楚如何将答案显示为计算器项目的单词? - I can't seem to figure out how to display answers as words for my Calculator Project? Key Listener 一直在监听更多的键,我不知道如何阻止它这样做 - Key Listener keeps listening for more keys, and i can't figure out how to stop it from doing so
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM