『壹』 java語言程序設計基礎篇(原書第八版)編程練習題2.17答案!急啊~!明天就要用
public class Exercise2_17 {
// Main method
public static void main(String[] args) {
java.util.Scanner input = new java.util.Scanner(System.in);
// Enter the temperature in Fahrenheit
System.out.print("Enter the temperature in Fahrenheit " +
"(must be between -58癋 and 41癋): ");
double fahrenheit = input.nextDouble();
// Enter the wind speed miles per hour
System.out.print("Enter the wind speed miles per hour " +
"(must be greater than or equal to 2) : ");
double speed = input.nextDouble();
// Compute wind chill index
double windChillIndex = 35.74 + 0.6215 * fahrenheit - 35.75 *
Math.pow(speed, 0.16) + 0.4275 * fahrenheit *
Math.pow(speed, 0.16);
// Display the result
System.out.println("The wind chill index is " + windChillIndex);
}
}
『貳』 求《java語言程序設計基礎篇原書第8版》李娜的那本 的課後復習什麼的答案
求一份地址 734164650@qq。com
『叄』 java語言程序設計基礎篇第八版的答案
這個應該是沒有的,除非是別人做的。你可以自己做,做不來再發問題問。
『肆』 Java編程語言基礎知識的要點有哪些
基本輸入輸出,數據類型,條件判斷,循環,類,對象
『伍』 java語言程序設計基礎篇原書第10版這本書怎麼樣
《Java語言程序設計(基礎篇 原書第10版)》是Java語言的經典教材,中文版分為基礎篇和進階篇,主要介紹程序設計基礎、面向對象編程、GUI程序設計、數據結構和演算法、高級Java程序設計等內容。本書以示例講解解決問題的技巧,提供大量的程序清單,每章配有大量復習題和編程練習題,幫助讀者掌握編程技術,並應用所學技術解決實際應用開發中遇到的問題。您手中的這本是其中的基礎篇,主要介紹了基本程序設計、語法結構、面向對象程序設計、繼承和多態、異常處理和文本I/O、抽象類和介面等內容。本書可作為高等院校程序設計相關專業的基礎教材,也可作為Java語言及編程開發愛好者的參考資料。
『陸』 跪求java語言程序設計基礎篇第六版復習題答案。我新來的,窮,體諒一下謝謝···
s
『柒』 《Java語言程序設計基礎篇》第六版的練習題和編程題答案
哥們我給你寫完了,耽誤了我半個小時的時間啊!你直接運行就可以了
import java.awt.BorderLayout;
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Calendar;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
public class Constellation implements ActionListener{
private JFrame frame = null;
private JTextField year = null;
private JTextField month = null;
private JTextField day = null;
private JLabel label1 = null;
private JLabel label2 = null;
private JLabel label3 = null;
private JPanel panel1 = null;
private JPanel panel2 = null;
private JButton button = null;
private JTextField output = null;
public static final String[] zodiacArr = { "猴", "雞", "狗", "豬", "鼠", "牛", "虎", "兔", "龍", "蛇",
"馬", "羊" };
public static final String[] constellationArr = { "水瓶座", "雙魚座", "牡羊座", "金牛座", "雙子座", "巨蟹座",
"獅子座", "處女座", "天秤座", "天蠍座", "射手座", "魔羯座" };
public static final int[] constellationEdgeDay = { 20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22,
22 };
/**
* * 根據日期獲取生肖 *
* @return 11.
*/
public static String date2Zodica(Calendar time) {
return zodiacArr[time.get(Calendar.YEAR) % 12];
}
/**
* * 根據日期獲取星座 *
* @param time *
* @return
*/
public static String date2Constellation(Calendar time) {
int month = time.get(Calendar.MONTH);
int day = time.get(Calendar.DAY_OF_MONTH);
if (day < constellationEdgeDay[month]) {
month = month - 1;
}
if (month >= 0) {
return constellationArr[month];
}
// default to return 魔羯
return constellationArr[11];
}
public Constellation(){
frame = new JFrame("計算生肖,星座");
year = new JTextField("",3);
month = new JTextField("",3);
day = new JTextField("",3);
label1 = new JLabel("請輸入年份:");
label2 = new JLabel(",請輸入月份:");
label3 = new JLabel(",請輸入日期:");
button = new JButton("查看結果");
button.addActionListener(this);
panel1 = new JPanel();
panel1.setLayout(new FlowLayout(FlowLayout.CENTER));
panel1.add(label1);
panel1.add(year);
panel1.add(label2);
panel1.add(month);
panel1.add(label3);
panel1.add(day);
panel1.add(button);
frame.setLayout(new BorderLayout());
frame.add(panel1,BorderLayout.NORTH);
panel2 = new JPanel();
output = new JTextField("",40);
panel2.add(output,JPanel.CENTER_ALIGNMENT);
frame.add(panel2,BorderLayout.CENTER);
frame.setSize(500, 100);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setVisible(true);
}
public void actionPerformed(ActionEvent e) {
output.setText("");
int y = Integer.parseInt(year.getText());
int m = Integer.parseInt(month.getText());
int d = Integer.parseInt(day.getText());
Calendar calendar = Calendar.getInstance();
calendar.set(Calendar.YEAR, y);
calendar.set(Calendar.MONTH, m);
calendar.set(Calendar.DAY_OF_MONTH, d);
String zodica = date2Zodica(calendar);
String constellation = date2Constellation(calendar);
String str = "您輸入的日期為:"+y+"年-"+m+"-月"+d+"日,得到的生肖:"+zodica+",星座:"+constellation;
output.setText(str);
}
//testcode
public static void main(String[] args) {
new Constellation();
}
}
『捌』 java語言程序設計基礎篇第8版和第10版哪個好
《Java語言程序設計(基礎篇 原書第10版)》Java語言經典教材文版基礎篇進階篇主要介紹程序設計基礎、面向象編程、GUI程序設計、數據結構算、高級Java程序設計等內容本書示例講解解決問題技巧提供量程序清單每章配量復習題編程練習題幫助讀者掌握編程技術並應用所技術解決實際應用發遇問題您手本其基礎篇主要介紹基本程序設計、語結構、面向象程序設計、繼承態、異處理文本I/O、抽象類介面等內容!