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.
“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.
Create a class called Rational for performing arithmetic with fractions. The result should be stored in reduced form. Use integer variables to represent the private data of the class— the numerator and the denominator. Provide a constructor that enables an object of this class to be initialized when it’s declared. The constructor should contain default values in case no initializers are provided and should store the fraction in reduced form. For example, the fraction would be stored in the object as 1 in the numerator and 2 in the denominator. Provide public member functions that perform each of the following tasks:
The result should be stored in reduced form of all these parts except part (f):
a) Adding two Rational numbers.
b) Subtracting two Rational numbers.
c) Multiplying two Rational numbers.
d) Dividing two Rational numbers.
e) Printing Rational numbers in the form a/b using << operators.
f) Printing Rational numbers in floating-point format using << operators.
bunty birthday:
hey!!its bunty bithday
bunty was born on 13 June 2000 he is curious to know ow many people in is locality have their birthdays on the same day,month,year
given buntyBirthday in the prefilled code and a birthdayList as an input, write js program to find the number of people having their birthdays
on the same day
in the same month
in the same year
input:['2000-05-13' , 'June 7 2021' ,'03/24/2000']
output:
1
2
["2011-12-31","2011-02-14",'June 17 1998','12/02/1990','1995-10-23']
o/p:
1
proper fractions
Given two fractional values A/C ,B/D where A,B are numbers and C,D are denominators you asked to add two fractional values, if the sum gives proper fraction as output print the proper fraction if it is improper ,convert it into a mixed fraction and print it if it is a whole number, print it
the 1st line of input contains two space separeted strings A/C, B/D
input:
1/2 1/4
o/p:
3/4
i/p:
1/2 3/4
o/p:
11/4(that means 1(1/4))
i/p:
1/3 2/3
o/p:
1
Dice Score:
two friends are playing a dice game, the game is played with five six-sided dice. scores for each type of throws are mentioned below.
three 1's = 1000 points
three 6's = 600
three 5's = 500
three 4's = 400
three 3's = 300
three 2's = 200
one 1 = 100
one 5 = 50
I/p: 2
1 1 1 1 1
6 6 6 1 5
O/p: 1200
750
I/p: 2
2 1 5 2 2
1 1 1 2 2
O/p: 350
1000
Number of moves:
you are given a nxn square chessboard with one bishop and k number of obstacles placed on it. A bishop can go to different places in a single move. find the total no.of places that are possible for the bishop in a single move. Each square is referenced by a type describing the row, R, and column, C, where the square is located.
explanation: given N=6 K=2
bishop position 5 2
obstacle positions (2 2), (1 5)
the bishop can move in so o/p is 6
I/p:
6 2
5 2
2 2
1 6
O/p:
6
I/p:
6 4
3 3
1 3
3 1
5 1
1 5
O/p: 7
Write a c++ program using string function that will accept the course
abbreviation as input value and it will display the corresponding
college.
Write a C++ function in which it reads namesfrom file “data.txt” into character array and remove
the repeating names. Write your updated names list in another file called “output.txt”
Example:
Data.txt
Hira
Ali
Ahmad
Imran
Ali
Warda
Annie
Ali
Kinza
Hira
Output.txt
Hira
Ali
Ahmad
Imran
Warda
Annie
Kinza