+ 7

Chess Tournament Scores

Introduction java Chess Tournament Scores practice is buged the answer is wrong i don't know what to do now pls help.

18th Dec 2022, 9:57 AM
Leon
17 Answers
+ 16
Your code?
18th Dec 2022, 10:17 AM
A͢J
A͢J - avatar
+ 13
System.out.println(wins+0.5*ties);
18th Dec 2022, 10:19 AM
Leon
+ 7
Leon, so everyone can help you. Please write what the task is and then save and attach your code in the code playground.
18th Dec 2022, 12:04 PM
Ausgrindtube
Ausgrindtube - avatar
+ 5
Chess Tournament Scores You are making a program for a chess tournament, that needs to calculate the points earned by a player. A win is worth 1 point, while a tie is worth 0.5 points. The given program declares two variables: wins and ties with the corresponding values. Create a program to calculate and output the points earned by the player. public class Program { public static void main(String[] args) { int wins = 54; int ties = 31; System.out.println(wins+0.5*ties); i did this and it didn't work. i looked at the solution and it is the same it just doesn't work.
18th Dec 2022, 12:27 PM
Leon
+ 4
</CODER> "ty" is text talk for Thank You
18th Dec 2022, 4:19 PM
Ausgrindtube
Ausgrindtube - avatar
+ 3
using system; public class chass; Public static void main(string args[]) { wins=Convert.ToInt32(Console.ReadLine()); ties=Convert.ToInt32(Console.ReadLine()); Console.WriteLine(wins*0.5*ties); } }
10th Mar 2023, 1:33 PM
Hamdu Ali
Hamdu Ali - avatar
+ 2
Hello everyone! He's what I did and it worked! Here's the answer: public class Demo { public static void main(String[] args) { double wins = 54; double ties = 31; double points = wins + ties*0.5; System.out.print(points); } } The result must be 69.5
10th Aug 2023, 8:31 PM
Natalia S. R.
+ 1
ty :)
18th Dec 2022, 12:59 PM
Leon
+ 1
public class Program { public static void main(String[] args) { double wins = 54.0; double ties = 31.0; double x = ties * 0.5; System.out.println(x+wins); } }
13th Jan 2023, 10:28 PM
Yogesh Gupta
Yogesh Gupta - avatar
+ 1
public class Program { public static void main(String[] args) { int wins = 54; int ties = 31; System.out.println(wins+0.5*ties); } }
28th Feb 2023, 2:39 AM
Sk Rizvan
Sk Rizvan - avatar
+ 1
using System; public class Program { static void Main(string[] args) { int wins; int ties; //your code goes here Console.WriteLine(); wins = int.Parse(Console.ReadLine()); Console.WriteLine(); ties = int.Parse(Console.ReadLine()); double points = wins + (ties * 0.5); Console.WriteLine( points); } }
3rd Jan 2024, 10:18 AM
Zwelibanzi Sekano
+ 1
System.out.println(wins+0.5*ties); Working
19th Feb 2024, 5:34 AM
Irfan Alam
Irfan Alam - avatar
0
It seems like the int for ties makes it rounded down. 31*0.5 should be 15.5, but in that code it would be 15, which would be wrong.
19th Dec 2022, 10:10 PM
Minho Yoon
Minho Yoon - avatar
0
public class Program { public static void main(String[] args) { //declare variables String name = "Howard"; /* declare the age int age = 42; */ //output values //System.out.println(name+" is "+age+" years old."); } }
17th Oct 2023, 11:54 AM
Stephen Mwangi Ndegwa
Stephen Mwangi Ndegwa - avatar
0
wins + (ties * 0.5)
22nd Jul 2024, 3:01 PM
Meena