Create a 500 element array and load the array with a series of numbers starting at the first position that is the square of the index. For example, at position 0 would be 0, at position 1 would be 1, at position 2 would be 4, at position 3 would be 9…. Etc. Ask the user for a number between 0 and 250,000 and let them know if that number is a square. Employ a binary search.
Write a C++ program to create a class "Wall" with private data members "length & height and public member functions "findArea & Wall
1 Daphne Bridgerton | 84 | 85 | 100
2 Simon Basset | 100 | 84 | 86
3 Anthony Bridgerton | 75 | 87 | 99
The first column is the Laboratory Exercise, second column is the Long Quiz and 3rd column is the Alternative Assessment
Create a program in Java that will read the CSV file and compute the Final Grade of the student using the computation below:
Lab Exercise * 30% + Long Quiz * 30% + Alternative Assessment * 40% = Final Grade
Then, display the final grade of each student.
Swap Competition
An English competition is being held where players have to play in groups of two. One of the players is given a word, and the second player has to choose a word such that, it is a rearrangement of the letters in the first player's word. They win if the above condition is satisfied. The number of groups is given by T.Write a programthat gives YES if they win and NO in the other case.
Note: All characters in the input will be in lower case.
Input
The first line of the input contains an integer T Each of the next T lines contains two words separated by space.
Output
The output should have the results of each of the T are given in the input.
groups that
All the results are separated by space.
Explanation
Given pairs
noon moon
part trap
Sample Input 1
2
noon moon part trap
Sample Output 1
NO YES
Sample Input 2
2
car rac
lock clock
Sample Output 2
YES, NO
A class called MyPoint, which models a 2D point with x and y coordinates. It contains:
Two private instance variables x (int) and y (int).
A constructor (__init__()) that constructs a point with the given x and y coordinates.
Getter and setter for the instance variables x and y.
Method setXY() to set both x and y.
Method getXY() which returns the x and y in a 2-element list.
A __str__ method that returns a string description of the instance in the format "(x, y)".
Method called distance(self, anotherpoint) that returns the distance from this point to the given MyPoint instance (called another), e.g.,
p1 = MyPoint(3, 4)
p2 = MyPoint(5, 6)
print(p1.distance(p2))
Method called distance_from_origin() method that returns the distance from this point to the origin (0,0), e.g.,
p1 = MyPoint(3, 4)
print(p1.distance_from_origin())
Write a C++ program that takes five alphabets from the user and ask the user to delete any
alphabet. You should store the alphabets in a char array.
Write a C++ program that creates an array “A” having 5 elements (in the main function). Then,
the program asks the user to enter values in this array. After that, the program should ask
question from user are you wanted to sort ascending or descending order kindly enter your
choice that’s you want to search in the array, also compute the sum of array for the ascending
order and difference of array for the descending order.
design a Website for a client based on a shipping logistics.
“Our state of the art algorithm allows you to simply input the width and height of your skyscraper, and using a specially trained machine learning model, it would automatically generate a “star” (*) image of the entire structure. Specifically, the foundation of the building would always be width + 2 stars wide, while the top of the tower contains 1 star if the width is an odd number, or 2 stars if the width is an even number. Are you ready to see how it works?”
) Apart from the base and the top level of the tower, every level starts and ends with a white space(" ").
The first line will contain a message prompt to width of the skyscraper.
The second line will contain a message prompt to height of the skyscraper.
The succeeding lines will contain the skyscraper pattern.
sprime
Time Limit: 2 sec
Memory Limit: 128000 kB
Problem Statement
Sara has developed a new algorithm to find sprime for a given range starting with 2
She will start from the end mark it sprime, and mark all its factors (excluding itself) as not sprime. Then she will find the next greatest unmarked number, mark it as sprime, and mark all its factors (excluding itself) as not sprime
Your task is to calculate the the number of sprimes that are actually prime
Input
The first line contains T the number of test cases.
Each of the next T lines contain an integer n.
Constraint:-
1 <= T <= 100
2 <= n <= 10000000
Output
Output T lines, one for each test case, containing the required answer.