I need help solving these problems in Java. Please show every step.
1. -((float)'{‘)+(char)’z’/(double)72
2. (byte)((byte)(‘X’*’,’))
3. !(!(false || false))
4. (short)((long)(‘}’-‘_’))
5. (byte)’s’/(‘-‘%42.35)==99.52f%24+37.37f-‘V’
6. (char)(67.15*’5’%(37.41f-36.46))
7. “green”+18+(char)’b’+(byte)(‘F’-53)
Expert Answer
package Sample;
import java.util.Scanner;
public class Samples2 {
public static void main(String[] args)
{
Scanner sc =new Scanner(System.in);
System.out.println(-((float)'{‘)+(char)’z’/(double)72);
// -((float)'{‘)+(char)’z’/(double)72
System.out.println((byte)((byte)(‘X’*’,’)));
//. (byte)((byte)(‘X’*’,’))
System.out.println(!(!(false || false)));
//. !(!(false || false))
System.out.println((short)((long)(‘}’-‘_’)));
//(short)((long)(‘}’-‘_’))
System.out.println((byte)’s’/(‘-‘%42.35)==99.52f%24+37.37f-‘V’);
//(byte)’s’/(‘-‘%42.35)==99.52f%24+37.37f-‘V’
System.out.println((char)(67.15*’5’%(37.41f-36.46)));
//(char)(67.15*’5’%(37.41f-36.46))
System.out.println( (“green”+18+(char)’b’+(byte)(‘F’-53)));
// “green”+18+(char)’b’+(byte)(‘F’-53)
sc.close();
}
}
Expected Output:
—————————————-
-121.30555555555556
32
false
30
false
green18b17