C++ Answers

Questions answered by Experts: 9 913

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

There is a singly linked list represented by the following structure: struct Node int data; struct Node* next; Implement the following function: struct Node DeleteNodes (struct Node* head); The function accepts a pointer to the start of the linked list, 'head' argument. Delete all such nodes from the input list whose adjacent on the right side has greater value and return the modified linked list. Note: . Return null if the list is empty (Incase of python if the list is No return None). Do not create a new linked list, just modify the input linked list an . return it. Example: Input: head: 6->2->5->4->9->7->2>1>5->9 Output: 65-9->7->2->9 Explanation: Node '2' is deleted as '2' < '5' then '4' is deleted as '4' < '9' then '1' deleted as '1' < '5' then '5' is deleted as '5' < '9'. Sample Input head: 9- 5 - 6 - 2 -> 7 Sample Output​

In data structure (output)
The weather service center of a certain city records the highest temperature, lowest temperature, and humidity of each day. Write a program that maintains three arrays and initializes the highest temperature, lowest temperature, and humidity in the three arrays, for each day of the first 10 days of a month. The program should then create a weather report that includes the following information:
Highest temperature and lowest temperature.
Diurnal variation in each day.
Humidity of each day and whether it is greater or less than the average humidity.
Finally, in an end note, it should display the maximum temperature, minimum temperature, and overall variation in temperature in the duration.
An upcoming conference about C/C++ programming has three sessions planned:
A session on the new features of C++ 17
A session on functional programming in C/C++.
A session on lambda functions
Attendees can subscribe for any session. The organizers want to keep track of which attendees are attending which session. Write a program that stores this information in a two-dimensional array of Booleans, where each row represents an attendee and each column represents their subscription for a session. You can restrict the program to seven attendees, resulting in a 7 x 3 array. The program should first have the user input the data for each attendee. Write two functions that take the array as their argument. One function should print out the number of people in each session and the other should return the number of people who subscribed to all sessions.

WAP which displays a given character, n number of times, using a function. 

When the n value is not provided, it should print the given character 80 times. 

When both the character and n value is not provided, it should print ‘*’ character 80 times.

[Write the above program in two ways:- -using function overloading. -using default arguments.


Algorithmic Problem

You are given the arrival and leaving times of n customers in a restaurant.

What was the maximum number of customers?

Input

The first input line has an integer n: the number of customers.

After this, there are n lines that describe the customers. Each line has two integers a and b: the arrival and leaving times of a customer.

You may assume that all arrival and leaving times are distinct.

Output

Print one integer: the maximum number of customers.

Example

Input:

3

5 8

2 4

3 9

Output:

2



Write a program to create a class to store details of a student ( name, roll and 3 subject marks ). Input details for 2 students and assign all the details of that student who is having higher average mark to a new student.

i) use member function

ii) use friend function

Write a program to create a class to store details of a student ( name, roll and 3 subject marks ). Input details for 2 students and assign all the details of that student who is having higher average mark to a new student.

i) use member function

ii) use friend function

write a c++ program to display your name,mobile no,reg no,college studying and address...
Create a class which stores name, roll no and total marks for a student. Input data for 11 students. Find the average marks scored by n students, store it as a data member of the class and display it using a function which may be called without object.

For each of the following, write a single statement that performs the single task. Define two integer

variables val1 and val2. Initialize the val1 to 2300.

1. Define a pointer myPointer to an object of type integer.

2. Assign the address of variable val1 to pointer.

3. Print the value of the object pointed to by myPointer.

4. Assign the value of the object pointed to by myPointer to variable val2.

5. Print the value of val2.

6. Print the address of val1.

7. Print the address stored in myPointer



LATEST TUTORIALS
APPROVED BY CLIENTS