Write a C function remove_blanks()that replaces two or more consecutive blanks in the input string by a single blank. For example, if the input is:
“Grim return to the planet of apes!!”
Then output should be:
“Grim return to the planet of apes!!”
The function should return the number of blank spaces removed. Remember that string is a null-terminated character array! The function prototype is given below:
int remove_blanks(char input_string[],char output_string[]);
Consider the following
Class date
{
private:
Int day;// from 1 to 31
Int month;// from 1 to 12
Int year;// from 2000 onwards
public:
Void advance() ;// move to next day
} ;
Task#1:
Implement a constructor that initialize new object of date to be set to the 1st of January 2000.
Task#2:
Implement setters for day, month and year.
Task#3:
Implement the advance method which moves to the next day, ensuring that all data members are updated appropriately.
sir how to solve this error
Traceback (most recent call last):
File "main.py", line 11, in <module>
print(a.translate(table))
AttributeError: 'list' object has no attribute 'translate'I can't run this code. Please help me correct it thenkyou! My code is too long, that's why I cut it, i can't post the whole code. When i run it, it says " EOL while scanning string literal"
def initialize_board():
global current_player
current_player = 'O'
board = [["for i in range(3))] for j in range(3)]
pos = 1
for row in range(3):
for clomun in range(3):
board[row][column] = pos
pos += 1
board[1][1] = 'X'
return board
Implement a class Employee which contains 2 data members (name, surname), a constructor, a function that reads data members from the user, and one that displays name and surname of an Employee object. Implement another class EmployeeInfo which inherits from Employee with additional data members as street, city and postal_code. This class must have access to the public member functions of the base class and implement three additional member functions NewAddress, NewName and Print. Write a main function that has an instance of EmployeeInfo and reads all data members and displays them.
A hospital has Patient Appointment Management System (PAMS), in which all the details of doctors, patients and appointments are given. In this scenario all the details of appointment and patients are shared with the doctor and all the doctors have access to fix and cancel the appointments. Similarly, patients are also authorized to view the doctors list and appointments. Following are the key points of the functionality of PAMS:
⦁ According to the system, patients get the basic information of the doctor, specialization, charges per hour and work hour.
⦁ The system will allow doctors to add/delete and update the schedule.
⦁ The doctors must be able to maintain per visit charges.
Q1. You are required to identify the entities for the above scenario.
Q2. You are also required to identify the attributes of each entity which is already identified in the above Q1.
It is the final of the world’s most prestigious cricket tournament, the Indian Premier League. In the final, the Chennai Super Kings (CSK) are playing against the Mumbai Indians (MI). There is one over left for the match to end and CSK require R runs to win with W wickets remaining.
It is the final of the world’s most prestigious cricket tournament, the Indian Premier League. In the final, the Chennai Super Kings (CSK) are playing against the Mumbai Indians (MI). There is one over left for the match to end and CSK require R runs to win with W wickets remaining.
An over consists of 6 balls. Each ball can result in any one of the following possibilities:-
If a ball results in a wicket, CSK’s remaining wickets will decrease by one. If a ball results in runs (either 6, 4, 7, 2 or 1), these runs are added to the runs that CSK have already scored.
The match ends when one of the following happens:-
* If CSK scores R runs, the match ends and CSK wins.
* If the match ends with CSK scoring exactly one run less than the required runs, then the match is a tie.
The Insurance Company has to find the minimum and maximum incentive given for their LIC Agents. Develop a C++ program to implement this using templates with exception handling.
* If the input value is 0 thrown an exception, print "An exception occurred!"
Runtime Input :
65
100
48
75
10
Output :
10
100
Implement class Rational / Fraction as shown below. Add features in that class
such as
a) Create a constructor that prevents a 0 denominator in a fraction
b) Create a function to reduce or simplify fractions that are not in reduced form
c) Overload the addition (+), subtraction (-), multiplication (*) and division (/) ,
assignment operator (=), compound operators +=, -=, *=, /=, the relational operators
(<, >, <=, >=, ==, !=), unary operators such as ++ postfix, ++prefix, --postfix,--prefix, +
unary and –unary, Insertion operator << and extraction operator >> (will be
implemented as friend functions )
Class Definition is as given below; you need to implement Fraction.cpp and main
file to test the operators.in c++