0% found this document useful (0 votes)
6 views3 pages

Java I/O Assignment Questions Guide

The document contains a series of assignment questions focused on Java I/O for reading user inputs. It includes tasks such as formatting and printing user details, concatenating strings, calculating total marks and percentage, and summing pairs of integers. Each question provides specific input and output examples to guide the implementation.

Uploaded by

vivekmanjhi1412
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

Java I/O Assignment Questions Guide

The document contains a series of assignment questions focused on Java I/O for reading user inputs. It includes tasks such as formatting and printing user details, concatenating strings, calculating total marks and percentage, and summing pairs of integers. Each question provides specific input and output examples to guide the implementation.

Uploaded by

vivekmanjhi1412
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Java i/o - reading inputs

in Java

Assignment Questions
Assignment Questions

Q1 - Input name, roll number and field of interest from user and print in the format below :
Name: xyz, Roll number: xyz, Field of interest: xyz
Input : Single line format
Aman Gupta 4053 Physics
Output :
Name: Aman Gupta
Roll Number: 4053
Field of interest: Physics

Q2 - Input two different string and print them in same line.


Input :
Level
Up
Output :
LevelUp

Q3 - If the marks of Robert in three subjects are entered through keyboard (each out of
100), write a program to calculate his total marks and percentage marks.
Input :
78
89
95
Output : Total marks: 262
Percentage marks: 87%

Q4 - Given two numbers, return their sum in the following format:


Int t representing number of test cases
T lines of Two integers representing the numbers to be added
Input :
3
45
18 20
49 27
Output :
9
38
76

Q5 - Given few lines of input(number of lines unknown) where each line has two
strings, concatenate the strings.
Input :
Hello World
Happy Faces
Sunny Day
Good Morning

Cracking the Coding Interview in Java - Foundation


Assignment Questions

Output :
HelloWorld
HappyFaces
SunnyDay
GoodMorning

Cracking the Coding Interview in Java - Foundation

You might also like