云南大学软件学院java实验九_云南大学软件学院Java实验二

云南大学软件学院

实验报告

姓名:学号:班级:日期:成绩:

JAVA实验二

一、实验目的:

进一步熟悉JAVA编译环境,编译三个简单的JAVA程序,熟悉JAVA语言。

二、实验要求:

1. Write Java program called AverageNumbers.java to determine the average of

several numbers.

Set the following five integer variables:

int1 = 5

int2 = 7

int3 = 4

int4 = 25

int5 = 13

Calculate and display the average of these numbers and the square root of average.

2. Write a temperature conversion Java program called FarheheitToCentigrade.java.

Set a variable called tempFarenheit = 98.6.

Calculate the Centigrade temp (tempCelcius) by using the formula Centigrade = 5/9 (Fahrenheit -32)

3.Write a Java payroll program called Payroll.java that determines pay and taxes.

Set the following variables:

pay = $25 per hour

hoursWorked = 40

Calculate grossPay by multiplying pay * hoursWorked.

Calculate taxesWithheld by multiplying grossPay * .15.

Calculate netPay by subtracting taxesWithheld from grossPay.

Display all variables.

三、实验内容:

1.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值