i am taking c++ class and
please show me this solution detailedly!


3.
CODE
#include <iostream>
using namespace std;
int main()
{
for (int i=0; i<=7; i++) {
for (int j=0; j<=7; j++) {
for (int k=0; k<=7; k++) {
if(i + j + k == 7) {
cout << i << " " << j << " " << k << endl;
}
}
}
}
return 0;
}
6.
CODE
#include <iostream>
#include <ctime>
#include <cstdlib>
using namespace std;
int main()
{
srand(time(0));
int a = rand() % 3;
int b = rand() % 3;
int c = rand() % 3;
if (a == 2 && b == 2 && c == 2) {
cout << 10;
}
else if (a == b && b == c) {
cout << 5;
}
else if (a != b && a != c) {
cout << 1;
}
else {
cout << 0;
}
return 0;
}
NOTE: As per Chegg policy, I am allowed to answer only 2 coding questions (including sub-parts) on a single post. Kindly post the remaining questions separately and I will try to answer them. Sorry for the inconvenience caused.
i am taking c++ class and please show me this solution detailedly! 0 0 7 016...
I really need help making a linked list program in C++, the program in total should have 3 source files: IntList.h IntList.cpp IntListTest.cpp The class should contain the following functions: Constructor Destructor (should use removeAll() function) insert(int) - inserts the given int into the list (in order, duplicates are allowed) remove(int) - removes the given int from the list. Returns true if successful, false otherwise. print() - prints the list in-order (all on one line, comma delimited; no comma at...
C code. Write a program to find all the triangles with integer side lengths and a user specified perimeter. Perimeter is the sum of all the sides of the triangle. Integers a, b and c form a triangle if the sum of the lengths of any two sides is greater than the third side. Your program should find all the triples a, b and c where a + b + c is user specified perimeter value. Print each triple only...
Please show all your work. I need step by step. How did
you solve? Please help me both part or both question. Please help
me with all question. Will give you thumbs up.
Part IV – True or False Each question is worth 1 point. For each of the following statements, determine whether it is true or false (circle the answer; you don't need to show any work). 1. True or False: The rank of a square matrix equals its...
Hello, I am working on a project for my C++ class, I have the vast majority of the code figured out but am running into a few issues. Mainly updating each * to an X. The problem is as follows:(Airplane Seating Assignment) Write a program that can be used to assign seats for a commercial airplane. The airplane has 13 rows, with six seats in each row. Rows 1 and 2 are first class, rows 3 through 7 are business...
Hello, If anyone would be so kind as to help me out with a
solution in either Java or C++ please and thank you !!!
CS 278 Lab3: Quantified statements Write a program that does the following. It should take as a user input ten different integers and store them in a length ten integer array (with no repeated entries). The domain D is the set of entries in this array. Recall that if the domain is a finite set...
So I am creating a 10 question quiz in Microsoft Visual Studio 2017 (C#) and I need help editing my code. I want my quiz to clear the screen after each question. It should do one question at a time and then give a retry of each question that was wrong. The right answer should appear if the retry is wrong. After the 1 retry of each question, a grade should appear. Please note and explain the changes you make...
I need help with this problem. Using Python please. Thanks Construct a class “Monster” with the following attributes: self.name (a string) self.type (a string, default is ‘Normal’) self.current_hp (int, starts out equal to max_hp) self.max_hp (int, is given as input when the class instance is created, default is 20) self.exp (int, starts at 0, is increased by fighting) self.attacks (a dict of all known attacks) self.possible_attacks (a dictionary of all possible attacks The dictionary of possible_attacks will map the name...
C Programming Can someone please explain me while the following (c) code prints out 6? for (i=1; x<=5; i++); printf ("%d",i); i=1 initializes the the loop, it is being tested whether it is <= 5 or not. This statement is true, so it goes into the loop and prints 1. After that, i++, means 1+1=2, i=2. This statement is being tested and it is true, we go into the loop and print 2. Then i=3, true, loop prints 3 -->...
Please help and follow instructions, c++ , let me know if there is any questions Description: This program is part 1 of a larger program. Eventually, it will be a complete Flashcard game. For this part, the program will Prompt the user for a file that contains the questions – use getline(cin, fname) instead of cin >> fname to read the file name from the user. This will keep you in sync with the user’s input for later in the...
JAVA Primitive Editor (Please help, I am stuck on this assignment which is worth a lot of points. Make sure that the program works because I had someone answer this incorrectly!) The primary goal of the assignment is to develop a Java based primitive editor. We all know what an editor of a text file is. Notepad, Wordpad, TextWrangler, Pages, and Word are all text editors, where you can type text, correct the text in various places by moving the...