0

You are making a program for a chess tournament I Java

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.

22nd Sep 2023, 4:00 AM
ADITYA LAMBA
ADITYA LAMBA - avatar
7 Respostas
+ 6
Wow that sounds fun! Do you have any questions about it? Share your attempt.
22nd Sep 2023, 4:04 AM
Chris Coder
Chris Coder - avatar
+ 5
Well the code works. Check your spacing in your output.
22nd Sep 2023, 4:24 AM
Chris Coder
Chris Coder - avatar
0
public class Program { public static void main(String[] args) { int wins = 54; int ties = 31; float total_points = (wins *1.0f)+(ties *0.5f); System.out.println("total points earned by player :" + total_points ); } }
22nd Sep 2023, 4:08 AM
ADITYA LAMBA
ADITYA LAMBA - avatar
0
This was my code and the compiler is showing bug in this Please correct it
22nd Sep 2023, 4:08 AM
ADITYA LAMBA
ADITYA LAMBA - avatar
0
ADITYA LAMBA , Also check your capitalization. The Sololearn code quizzes do a simple string compare between your output and the expected output. Every character has to be exactly the same to pass.
22nd Sep 2023, 5:13 PM
Rain
Rain - avatar
0
using System; public class Program { static void Main(string[] args) { int wins = Convert.ToInt32(Console.ReadLine()); int ties = Convert.ToInt32(Console.ReadLine()); double pointsEarned = wins + (ties * 0.5); Console.WriteLine(pointsEarned); } }
24th Feb 2024, 2:27 PM
isika gupta
isika gupta - avatar
0
using System; public class Program { static void Main(string[] args) { int wins=Convert.ToInt32(Console.ReadLine()); int ties=Convert.ToInt32(Console.ReadLine()); double d=(wins*1)+(ties*0.5); Console.Write(d); //your code goes here } }
24th Aug 2024, 12:43 PM
CHUNDRU SURENDRA
CHUNDRU SURENDRA - avatar