编码最后一条打印线的正确方法是什么? [英] What is the correct way to code the last print line?

查看:79
本文介绍了编码最后一条打印线的正确方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

//expressions used to calculate the weight for each exam and hw assignment.

    public static double grades(double weightedHomeworkScore, double weightedmid1Score, double weightedfinal2Score) {
        double weightedHomeworkScore=(score1+score2+score3+(sections*4)/maxPossible1+maxPossible2+maxPossible3+sectionsMax)*homeWeight;
        return round2(weightedHomeworkScore);
        double weightedmid1Score=((mid1/100)*mid1Weight);
        return round2(weightedmid1Score);
        double weightedfinal2Score=((final2/100)*final2Weight);
        return round2(weightedfinal2Score);
    }                                                                         
    
    // Returns the given double value rounded to the nearest hundredth. 

    public static double round2(double number) { 
        return Math.round(number * 100.0) / 100.0;
        System.out.println("Course grade=" + round2(int grades));





我尝试过:



我学习java已经有4个星期了,我已经摆弄了周围的一切以及切换最后一个打印语句的设计。我不知道该怎么解决这个问题所以我可以上交作业。



What I have tried:

I am 4 weeks into learning java and I have fiddled around with everything around it as well as switching the design of that last print statement. I am not sure what to try to fix this so I can turn in the assignment.

推荐答案

你好,



我认为在你完成任务之前你需要了解一些事情(学习)。一旦你对程序流程有了基本的了解(即程序封装在一个类中并需要一个主要的方法来运行),变量声明和用法(变量与参数),方法,不要担心你离开的时间申报和使用你不会花费超过2个小时来完成它。



你的程序将无法以当前状态运行。首先创建一个类,然后创建main方法,然后从那里开始。



编译错误会让你保持正常。



我推荐Head First Java作为首发。



快乐学习。
Hello,

I think you have a few things to know (learn) before you do the assignment. Do not worry of the time you have left, once you have the basic understandings of the program flow (viz. the program is encapsulated in a class and needs a main method to run), variable declaration and usage (variable vs parameter), method declaration and usage you'll not take more than 2 hours to complete it.

Your program won't run in it's current state. Start by creating a class and then the main method, then take it from there.

The compiler errors will keep you on track.

I'd recommend Head First Java as a starter.

Happy learning.


这篇关于编码最后一条打印线的正确方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆