ONLY IN C++
Upvote for correct
Create a program which can test the validity of propositional logic. Remember, a propositional logical statement is invalid should you find any combination of input where the PROPOSITIONAL statements are ALL true, while the CONCLUSION statement is false.
Propositional Statements:
If someone has a rocket, that implies they’re an astronaut.
If someone is an astronaut, that implies they’re highly trained.
If someone is highly trained, that implies they’re educated.
Conclusion Statement:
A person is educated, that implies they have a rocket.
Your output should declare the statement to either be valid or invalid. If it’s invalid, it needs to state which combination of inputs yielded the statement invalid. MAKE SURE IT POINTS OUT EVERY TIME THE STATEMENT IS INVALID IF IT IS INDEED INVALID.
C++ ONLY!
Thank you.
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images
- Implement the following function, without using any data structure. /* Given two vectors of chars, check if the two vectors are permutations of each other, i.e., they contains same values, in same or different order.e.g., V1=[‘a’,’b’,’a’] and V2=[‘b’,’a’,’a’] stores same multi-set of data points: i.e., both contains two ‘a’, and one ‘b’. e.g., V3=[‘a’,’c’,’t’,’a’] and V4=[‘a’,’c’,’t’] are not same multi-set. V3 contains two ‘a’s, while V4 has only one ‘a’. Note: when considering multiset, the number of occurrences matters. @param list1, list2: two vectors of chars @pre: list1, list2 have been initialized @post: return true if list1 and list2 stores same values (in same or different order); return false, if not. */ bool SameMultiSet (vector<char> list1, vector<char> list2)arrow_forwardI need help figuring out this program and putting it in c++.arrow_forwardBy implementing the concepts of Classes and Objects, write a C++ program that determines the slope of a line from the coordinates, P(x,y), of the 2 points. The coordinates of the 2 points: P1 (x1, y1) and P2 (x2, y2) are to he entered from the keyboard. The slope, m, of the line is computed as: m=(y2-y1/x2-x1) Accomplish the following for the given class diagram: 1.) Create the class implementation using C++ 2.) Using the constructor, create 2 objects, P1 and P2, from class Point and store them in the heap memory. 3.) Implement the functions of the 2 objects. NOTE: The member function setXY is used to enter the values of x and y from the keyboard. Sample input/output display: Enter the coordinates of the 1st point (x1 y1): 1 1 Enter the coordinates of the 2nd point (x2 y2): 5 4 The slope of the line, m=0.75arrow_forward
- Write a C++ program for the following. In each plastic container of Pez candy, the colors are stored in random order. Your little brother only likes the yellow ones, so he painstakingly takes out all of the candies, one at a time, eats the yellow ones, and keeps the others in order so he can return them to the container in exactly the same order as before, minus the yellow candies, of course. Write a program to simulate this process. You must use Nyhoff's stack class; other solutions including the use of the STL stack class are unacceptable. Assume that the candies are denoted as Y for yellow, B for blue, R for red, O for orange. Your program is to query the user for ten letters (representing ten Pez candies), and after using appropriate stack operations, display the contents of the container minus the yellow candies. The order in which the letters are entered is the order that they were removed from the Pez container. When your answer is displayed the results must be in the same…arrow_forwardThe language for the question is C++arrow_forwardwrite a c++ program, Consider the below designs. If triangle and rectangle are two class having show function in both classes. Write a program which prints design using OOP concepts Note: Code with comments and output screenshot is must. Thank you!arrow_forward
- Output the information as a formatted histogram. Each name is right justified with a setw() value of 20. Jane Austen ****** Charles Dickens ******************** I need to know how to output a value in the amount of asterisks. Please help me with this problem using c++.arrow_forwardC++arrow_forwardWrite a program in C++ which adds, subtracts, multiplies, divides and performs exponentiation on two specific numbers. The two numbers should be entered by the user. Each output should include a string describing what the numerical output is being displayed. Use the if-else-if ladder so that the user is able to select which mathematical function to perform. Make sure the program has a neat menu for the user to use to select their choice. Also, avoid having the computer perform a division by zero if the user attempts it by outputting a warning message in its place (use an if-else statement). Include your C++ source code as well as the output of your program in your submissionarrow_forward
- Solve the following C++ problem.arrow_forwardIn C++ Use naming conventions for variables, functions, methods, and more. This makes it easier to understand the code. Write simple code and do not over complicate the logic. Code exhibits simplicity when it's well organized, logically minimal, and easily readable. Write a program whose input is two integers, and whose output is the first integer and subsequent increments of 5 as long as the value is less than or equal to the second integer. Ex: If the input is: -15 10 the output is: -15-10-505 10 Ex: If the second integer is less than the first as in: 20 5 the output is: Second integer can't be less than the first.arrow_forwardWrite a C++ program by using classes in which user enter the number, program will reverse the number. After reversing the number, show the sum of all numbers. For example if number is 153, the after reverse it will be 351 and the sum will be 9. Now if the sum is a odd number, then show its odd number, otherwise show even number. Just even odd module must be implemented with operator overloading. Further, you are not allowed to use for loop. You can use Do while loop.arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY