Combine Two Dictionaries Write a program to combine two dictionaries updating values for common keys. Input The first line of input will contain space-separated strings, denoting the keys of first dictionary. The second line of input will contain space-separated integers, denoting the values of first dictionary. The third line of input will contain space-separated strings, denoting the keys of second dictionary. The fourth line of input will contain space-separated integers, denoting the values of second dictionary. Output The output should be a single line containing the list of tuples of dictionary items with all the key-value pairs of two dictionaries sorted in ascending order by key.
Create a program based on the attached output using a for loop.
Output:
Enter hidden number: 50
Set of how many attempts to allow the user to guess: 5
Enter your guess number: 45
Sorry! Your guessed number is lesser than the hidden number.
You have 4 attempts left.
Enter your guess number: 51
Sorry! Your guessed number is greater than the hidden number.
You have 3 attempts left.
Enter your guess number: 10
Sorry! Your guessed number is lesser than the hidden number.
You have 2 attempts left.
Enter your guess number: 17
Sorry! Your guessed number is lesser than the hidden number.
You have 1 attempts left.
Enter your guess number: 49
Sorry! Your guessed number is lesser than the hidden number.
You have 0 attempts left.
Sorry you failed to guess the number please try again later.
Write C++ program to create a base class named Person that includes variables: name and age and then define a derived class named Student that includes four functions setName(), setAge(),setMark(), getName(), getAge() and getMark () to set and return the name of student, age and mark. then define a derived class named Student2 which is derived from both above classes and includes one function named checkAge() to check if the age of students Less than 12 then the student is in primary school and checkMark() to check if mark is less than 50 then student is passes the exam.
Instructions:
Code:
#include <iostream>
using namespace std;
int main() {
char array[100] ="supercalifragilisticexpialidocious";
return 0;
}
Instructions:
Code:
#include <iostream>
using namespace std;
// TODO: Declare the hasConsonant() function here
int hasConsonant(int code)
int main(void) {
char code[100];
cout << "Enter the code: ";
cin >> code;
int result = hasConsonant(code);
if(result == 1) {
cout << "ALERT! There is a consonant in the code!";
} else if(result == 0) {
cout << "There is no consonant in the code. Situation is under control!";
}
return 0;
}
// TODO: Define the hasConsonant() function here
#include <iostream>
using namespace std;
int main(void) {
int winnings[100] = {
1,3,2,4,5,7,6,8,9,11,
100,13,0,14,16,17,3,18,20,10,
12,8,15,14,5,17,19,18,1,9,5,
10,13,11,14,16,22,0,18,20,3,
99,13,15,14,22,17,19,0,23,2,
12,13,15,22,16,17,56,18,44,99,
2,13,22,14,16,89,19,69,101,34,
12,22,15,14,78,17,69,18,2,33,
4,13,77,7,10,17,19,91,4,22,
12,98,15,14,15,17,19,18,7
};
// TODO: Compute and print the sum of all the winnings here
return 0;
}
Create an enumeration named Month that holds values for the months of the year, starting with
January equal to 1. Write a program that prompts the user for a month integer. Convert the
user’s entry to a Month value, and display it.
In this task, we implement multiple inheritance. We create two classes, a ‘Mammal’ and a
‘Bird’ class. Then we create another class which inherits both the classes, we name the third
class ‘Organism’. Consider including the following attributes and functionalities to your
classes.
class Mammal
void setMammalName(string);
void showMammal();
class Bird
void setBirdName(string);
void showBird();
class Organism
void setOrganismName(string);
void showOrganism();
char* getOrganismName();
How to display a c++program showing five students plus there registration numbers.
Write a program that reads in two integers and determines and prints if the first is a
multiple of the second.
a) first the program using if statements
b) then the program using if/else statements