find the class of each address.
a) 00000001 00001011 00001011 11101111
b) 11000001 10000011 00011011 11111111
c) 14.23.120.8
d) 252.5.15.111
Given list sorting array and same frequency
Input:
[2 6 3 1 8 12 2 9 10 3 4]
Output:
[1 2 2 3 3 4 6 8 9 10 12]
2 3
Switch Statement
Sample output:
Enter any one of the alphabets a,b,or c:A
You are in case A
Sample output 1:
Enter any one of the alphabets a,b,or c:a
You are in case a
Sample output 2:
Enter any one of the alphabets a,b,or c:b
You are in case b
Make a program that will use the scanner and will output strings, int and double
ENTER FULLNAME
ENTER ADRESS
ENTER STATUS
ENTER SCHOOL NAME
ENTER FIRST NUMBER
ENTER FIFTH NUMBER
ENTER FIRST DECIMAL NUMBER
ENTER FIFTH DECIMAL NUMBER
Develop a java program to get n numbers as input and find the second duplicate and print the reverse of a number
First line contains the value n and the remaining lines contain the corresponding input
Input:
5
11
24
33
11
24
Output:
42
Note:
If the second duplicate is single digit, print as it is
If there is no second duplicate, print the first duplicate itself
If there is no duplicate, print "No duplicate found
Create and Print List -3:
You are given N numbers as input. Create a list and add the N numbers which are given as input and print the list.
The first line of input is an integer N. The next N lines each contain an integer.
Explanation:
In the given example,
N=4 and the numbers are 1, 2, 3, 4. So, the output should be [ 1, 2, 3, 4 ]
Sample Input 1
4
1
2
3
4
Sample Output 1
[1, 2, 3, 4]
Sample Input 2
3
13
21
19
Sample Output 2
[13, 21, 19]
can i get code without using append
Write a class that has three overloaded methods for calculating the areas of the following geometric shapes:
• Circle
• Rectangle
• Cylinder
Here are the formulae for calculating the area of the respective shapes:
Shape: Circle
Area Formula: A = πr2
Notes: π is Math.PI and r is the circle’s radius
Shape: Rectangle
Area Formula: Area = Width * Height
Shape: Cylinder
Area Formula: Area = 2πrh + 2πr2
Notes: π is Math.PIand r is the radius of the cylinder’s base h is the cylinder’s height
Sanjay is recruited in Infosys company as a python developer. The company assigned him a software development task to build a compiler. Sanjay identifies that for compiler designing he need to implement tokenization of a specific line of program. As a friend of Sanjay, your task is to help him to write a python function Tokenize_Line(fname, n) (Refer RollNo_W11A_2.py )which reads nth line from prime.py file and returns a list containing all tokens of that line as shown in the example. Also, handle the possible exception and provide proper message.
Contents of prime.py file will be like:
from math import sqrt
n = 1
prime_flag = 0
if(n > 1):
for i in range(2, int(sqrt(n)) + 1):
if (n % i == 0):
prime_flag = 1
break
if (prime_flag == 0):
print("true")
else:
print("false")
else:
print("false")
You are given a file read.txt which contains some lines. As a python developer, you need to write a python function Read_Contents(fname, n) (Refer RollNo_W11A_1.py )which takes the name of the files and number of lines to be read from file. The function returns those lines in a string as shown in example.
Contents of read.txt file will be like:
This is python Lab.
The is the program for file handling.
Reading first n lines !