91嫩草国产线免费观看_欧美日韩中文字幕在线观看_精品精品国产高清a毛片_六月婷婷网 - 一级一级特黄女人精品毛片

有一道關于java的英文編程題求大神幫忙編一下!!

首頁 > 知識產權2022-08-26 09:59:43

明天要考試了,有一道關于java的編程題想請大家幫幫忙啊 ,急!謝謝了

創建一個名稱為MainPackage的包,使它包含ParentClass和SubCla。ParentClass包含變量聲明,其值從構造函數中輸出。SubClass類從父類派生而來,完成對父類變量的賦值。創建一個名稱為DemoPackage的主類,使它不在MainPackage包中,在該類中創建一個SubClass類的對象。
package MainPackage;

class ParentClass {
String s = "this is ParentClass!";
public ParentClass(){
System.out.println(s);
}
}
class SubClass extends ParentClass{

public SubClass(){
super.s = "this is SubClass!";
System.out.println(s);
}
}
import MainPackage.ParentClass;

public class DemoPackage {

public static void main(String[] args) {
SubClass sub = new SubClass();

}

}
我總結一下,一樓正解。

求java大神幫忙解決兩道英文的編程題

第一個: Write a complete program that will use a Scanner to ask for the total marks for your tests, assignments and labs each as a percentage (out of 100). If the lab mark is higher than the assignments the lab mark is omitted and the tests are weighted at 50% and the assignments at 50%. Otherwise the tests are weighted at 50% the assignments at 25% and the labs at 25%. The program then computes and prints your final grade as a letter. If you get 80% or higher the letter grade is an A, 70 or higher is a B, 60 or higher a C, 50 or higher a D and less than 50 an F. rnrnrnrnrnrn第二個: Write a program that will ask a user for the total hours worked. If the hours worked <= 35 hours the program must write that you are a part-time worker and print your hours worked. If you work <= 40 hours the program must write that you are a full time worker and print your hours worked AND If you work more than 40 hours the program must write that rnrnyou are a full time worker and must write your hours worked and overtime hours. [TAs please advise the students not to use the Booleans operators && or ||. This lab is designed to teach if statements and if – then – else statements]rnrnrnrnSample run:rnrnrnrnPlease type your hours worked: 34rnrnYou are a part time workerrnrnHours worked: 35rnrnrnrnPlease type your hours worked: 36rnrnYou are a full time worker.rnrnHours worked: 36rnrnrnrnPlease type your hours worked: 41rnrnYou are a full time worker.rnrnHours worked: 41rnrnOvertime hours: 1
第一題輸入測試成績,
100>=成績>=80:A
80>成績>=70:B
70>成績>=60:C
60>成績>=50:D
50>成績>=0:F

表示看到大段英文我就眼花  o(╯□╰)o

Java簡單編程就是英文版的 求大神幫忙編一下!感謝!

A bank needs to transport money from location A to location B. To do this they need to calculate the volume needed for the transports. rnYour task is to create a method that takes as parameters how many stacks of money is to be transported and the size of the stacks. The method shall calculate and return the volume needed. The size sent as parameter shall be specified as length, width and height. rnCall the method with different values to make sure it works. The returned value together with the values used for the calculation shall be printed to the screen. Double check by calculating it by hand. rnMust use at least: 1. One method that takes four parameters and return a value
/*先應該梳理一下你的需求,你的任務是從第二段英文開始的,即:你的任務是創建一個函數(即方法),這個函數的參數有:被運送的money堆,money堆的大小,寬度和高度;返回值嘛,你就返回有多少money就行了。*/
 
import java.util.ArrayList;
import java.util.List;
 
class MoneyStack
{
   //TODO:根據自己的需求定義成員函數和變量,你的需求沒有給出。
}

//theMoneyStackSize這個參數可以不要,是多余的
public int calculateMoney(List<MoneyStack> theMoneyList, int theMoneyStackSize, int theWidth, int theHeight)
{
    int aTotalMoneyValue;
    // TODO:計算過程,你所給的需求沒說怎么計算。
    return aTotalMoneyValue;
}

[小女在國外學習]有一道Java編程的英文作業題,遠程求助國內大神們,明天要交。。。求大神們救急!!

  1. Create a class called BankAccount with these fields: idNumber, name and balance. Provide readers and writers for all these fields. Each writer should return the previous value of the field it updates.  
           Provide all appropriate constructors plus methods conforming
    to these method headers:
     

         

    1.1 public void deposit( BigDecimal amount )  // add amount to current balance
           

    1.2 public boolean withdraw( BigDecimal amount )  // subtract amount from current balance; return false if not enough money



    (We mentioned the BigDecimal class when we discussed the shortcomings of the float and double primitive types -- look it up in the Javadoc documentation available through the
    Eclipse IDE menu system, or directly from Oracle.)


2. Create a sub-class of BankAccount called SavingsAccount,
       adding this field: interestRate.   Also add a method conforming to this header:


   public BigDecimal calcInterest() // add (balance*interestRate) to balance



(This is a very naive way to handle interest calculations)
       


3. Write a test driver class called "Driver" to
exercise all the methods of the BankAccount and
SavingsAccount classes, clearly printing inputs
and outputs, so the grader can easily tell what works
(everything, we hope) and what doesn't. 


救急救急救急。。。求程序

What's ur email, i will send the full version to you.


package testProject;
import java.math.BigDecimal;
public class BankAccount {
protected String idNumber;
protected String name;
protected BigDecimal balance;
//default constructor
public BankAccount(){
idNumber = "";
name = "";
balance = BigDecimal.ZERO;
}
//Create a default balance account
public BankAccount(String idNumber, String name){
this.idNumber = idNumber;
this.name = name;
this.balance = BigDecimal.ZERO;
}
//Create a account with deposit
public BankAccount(String idNumber, String name, BigDecimal balance){
this.idNumber = idNumber;
this.name = name;
this.balance = balance;
}
//make deposit
public void deposit(BigDecimal amount){
balance = balance.add(amount);
}
//withdraw money
public boolean withdraw(BigDecimal amount){
if(balance.compareTo(amount)<0){
return false;
}else{
balance = balance.subtract(amount);
return true;
}
}
//Reader of IdNumber
public String getIdNumber() {
return idNumber;
}
//Writer of IdNumber
public String setIdNumber(String idNumber) {
String oldIdNumber = this.idNumber;
this.idNumber = idNumber;
return oldIdNumber;
}
//Reader of Name
public String getName() {
return name;
}
//Writer of Name
public String setName(String name) {
String oldName = this.name;
this.name = name;
return oldName;
}
//Reader of balance
public BigDecimal getBalance() {
return balance;
}
//Writer of balance
public BigDecimal setBalance(BigDecimal balance) {
BigDecimal oldBalance = new BigDecimal(this.balance.doubleValue());
this.balance = balance;
return oldBalance;
}
}

相關推薦:

知識產權訴訟面臨的挑戰(知識產權保護所面臨的挑戰有哪些)

什么是發明專利申請公布(發明專利申請的公布是什么)

專利權人怎樣轉讓權利(專利權轉讓的幾種方式)

實用新型專利查詢(實用新型專利在哪里查)

商標權如何取得(商標授權怎么弄)