小编The*_*ech的帖子

Java System.out行未正确执行

我的System.out Java行未正确执行,因此导致它们在一行上打印每行的一半.我不确定这里有什么问题.根据我的说明,他们似乎看起来没问题.有什么想法吗?

码:

System.out.printf("The circumference of a circle with radius ", radius,  " is: ", circumference, ".\n");
System.out.printf("The area of a circle with radius ", radius, " is: ", areacircle, ".\n");
System.out.printf("The area of a sphere with radius ", radius, " is: ", areasphere, ".\n");
System.out.printf("The volume of a sphere with radius ", radius, " is: ", volumesphere, ".\n");
Run Code Online (Sandbox Code Playgroud)

输出:

输入半径:2.5具有半径的圆的圆周具有半径的圆的面积具有半径的球的面积具有半径的圆的体积

java printf system.out

1
推荐指数
1
解决办法
64
查看次数

数学值无法正确计算

出于某种原因,我得到的数学值不同于我应该得到的数学值.我在这做错了什么?

码:

overtimeHours = hoursWorked - 40;

regularPay = hourlyWage * hoursWorked - overtimeHours;
overtimePay = 1.5 * hourlyWage * overtimeHours;
totalPay = hourlyWage * hoursWorked + overtimePay;
Run Code Online (Sandbox Code Playgroud)

输出:

Please enter employee's name: John
Please enter The Dragon's hourly wage: 22.50
Please enter how many hours The Dragon worked: 48.5

John's Wages
Regular Pay: $    1082.75
Overtime Pay: $    286.88
Total Pay: $    1378.13
Run Code Online (Sandbox Code Playgroud)

java math system.out

0
推荐指数
1
解决办法
54
查看次数

标签 统计

java ×2

system.out ×2

math ×1

printf ×1