hello! So I have this CIS assignment lab but when I try to make the code I don't really know where to start from. My professor is very hard and he likes to see the outcomes as they are shown in the problem. Please help me! the program should be a C++ PLS
Write a program that can be used as a math helper for an
elementary student. The program should display two random integer
numbers that are to be added, such as:
247
+ 129
-------
The program should wait for the students to enter the answer. If
the answer is correct, a message of congratulations should be
printed. If the answer is incorrect, a message should be printed
showing the correct answer.
The program displays a menu allowing the user to select an
addition, subtraction, multiplication, or division problem. The
final selection on the menu should let the user quit the program.
After the user has finished the math problem, the program should
display the menu again. This process is repeated until the user
chooses to quit the program.
Input Validation: If the user select an item not on the menu,
display an error message and display the menu again.
Requirements:
Addition
Generate two random numbers in the range 0 - 9.
Subtraction
Generate two random numbers in the range 0 - 9.
num1 = rand() % 10;
num2 = rand() % 10;
Make sure num2 <= num1...
while (num2 > num1)
num2 = rand() % 10;
Multiplication
Generate two random numbers. The first in the range 0 - 10, the
second in the range 0 - 9.
Division
Generate a single digit divisor
num2 = rand() % 9;
Generate a num1 that is a multiple of num2 so the division has no
remainder. The num1 is never zero.
num1 = num2 * (rand() % 10 + 1);
All constant values must be declare as a constant variable. Use
the constant variable in the calculation.
Validating the selection (1 to 5). If the selection is not in the
range between 1 and 5, the program keeps asking the input until the
correct selection is entered.
Comments in your program to explain the code logic and
calculation.
Output sample:
Menu
1. Addition problem
2. Subtraction problem
3. Multiplication problem
4. Division problem
5. Quit this program
Enter your choice (1-5): 1
1
+ 2
---
4
Sorry, the correct answer is 3.
Menu
1. Addition problem
2. Subtraction problem
3. Multiplication problem
4. Division problem
5. Quit this program
Enter your choice (1-5): 7
The valid choices are 1, 2, 3, 4, and 5. Please choose: 2
8
+ 6
---
2
Congratulations! That's right.
Menu
1. Addition problem
2. Subtraction problem
3. Multiplication problem
4. Division problem
5. Quit this program
Enter your choice (1-5): 3
9
* 4
---
36
Congratulations! That's right.
Menu
1. Addition problem
2. Subtraction problem
3. Multiplication problem
4. Division problem
5. Quit this program
Enter your choice (1-5): 4
8 / 2 = 4
Congratulations! That's right.
Menu
1. Addition problem
2. Subtraction problem
3. Multiplication problem
4. Division problem
5. Quit this program
Enter your choice (1-5): 4
6 / 2 = 3
Congratulations! That's right.
Menu
1. Addition problem
2. Subtraction problem
3. Multiplication problem
4. Division problem
5. Quit this program
Enter your choice (1-5): 5
"Thank you for using math helper!"
In: Computer Science
Consider a set of n boxes with their positions numbered from 1
to n. Initially all the boxes
are CLOSED. These n boxes are subject to modifications over n
iterations as follows. At the ith
iterations the boxes at the positions whose ids are multiples of i
are flipped, i.e. changed from
CLOSED to OPEN or vice-versa. For example, at iteration 1, boxes at
all positions are
flipped, at iteration 2, boxes at positions 2,4,6,etc. are flipped,
at iteration 3, boxes at positions 3,6,9, etc.
are flipped.
Propose an algorithm for find out, that after n such iterations how
many boxes will be OPEN.
Note that the answer requires only how many boxes, not their
positions. Describe the rationale
for the algorithm, give the pseudocode, and its
complexity. Grading scheme: (your grade will be
based on whichever class your algorithm falls in)
- For algorithms with complexity O(kn), where k is the
number of digits of n.
In: Computer Science
Grocery Store using Java Arraylist
Requirements:
1. Need Product Class and Stock Class
2. Use arraylist to store/ add product in stock
3. Product must have name, code number and quantity in stock
4. Print list of the products and their stock quantity
5. Search products based on their name 6. Remove product based on their code number
7. Sell product and deduct quantity from stock
8. Stock Class contains methods of search product, add product and check quantity of the product
9. Product Class contains method of get product details
In: Computer Science
Please write this program in C++
Write a program that
- a user-defined class Cuboid which has the following elements:
- default constructor (has no parameters)
- constructor that has 3 parameters (height, length, width)
- data members
- height, length, width
- member functions
- to set the value of each of the data members - 3 functions
- to get the value of each of the data members - 3 functions
- one that returns the volume
- one that returns the surface area
- one that increases each dimension by a specified factor
(Function definitions outside of the class!!!)
- in main()
- instantiate a Cuboid object and initialize at the time of definition
- make sure the constructor with parameters is called
- define an array of 2 Cuboid objects
- using a loop get information to populate the 2 objects in the array
-prompt for the height, length, and width
-prompt for a size by which to increase each dimension(one input)
-call a global function passing a Cuboid object and the increase factor as separate arguments; function will call the class member function to increase the dimensions; parameters of the function should be references
-display the dimensions, the volume, and the surface area for each of the three objects.
In: Computer Science
In python
import numpy as np
Given the array b = np.arange(-6, 4) compute and print
1.) The array formed by \(bi^2 - 1\), where the \(bi\) are the elements of the array b.
2.) The array formed by multiplying b with the scalar 100.
3.)The array formed by 2.0 b i in reverse order. (Note: the base 2.0 must be a floating point number; for integer values a ValueError: Integers to negative integer powers are not allowed. is raised.)
4.) The array delta of length len(b)-1 that contains the differences between subsequence entries of \(bi^3\), namely \(\deltai = b{i+1}^3 - bi^3 \) with 0 ≤ i < N − 1 where N is the length of b. Print both delta.shape and delta.
In: Computer Science
Modeling multiprogramming: (a) Assume the I/O fraction time of all processes is 20%, and assume processes are independent from each other, what’s the CPU utilization, if the number of processes, n = 1, 2, 4, and 8, respectively? (b) If the I/O fraction time is 50% for all processes, what’s the CPU utilization again, if the number of processes, n = 1, 2, 4, and 8, respectively?
In: Computer Science
1, Bitcoin and blockchain are the same thing.
true
false
2, Operational efficiency and operational effectiveness are the same thing.
true
false
3, Bill Gates was the sole founder of Microsoft.
true
false
In: Computer Science
Project on a double pendulum using MATLAB. I have simulated double pendulum chaos using the code I found in Chegg. Could you please guide in adding a code to determine the time it takes for the second arm of the pendulum to "flip" based on initial starting conditions?
In: Computer Science
List at least six reasons of why mobile apps are essential and preferable than traditional websites for everyday business
In: Computer Science
Do the following: • Download Wireshark. • Start Wireshark. • Turn on Wireshark capture. • Type a URL in your browser window (not Wikipedia.org). • After a few seconds, stop the capture. • Answer the following questions: 1a. What URL did you use? What was the IP address of the webserver?
1b. Find the frame in which your PC sent the SYN packet. List the source and destination IP address, the source and destination port numbers, and the header checksum.
1c. Select the SYN/ACK packet. List the source and destination IP address, the source and destination port numbers, and the header checksum.
1d. Select the packet that acknowledges the SYN/ACK segment. List the source and destination IP address, the source and destination port numbers, and the header checksum. 2. Change the options so that only packets you send are recorded. Do a capture. Click on the window containing Wireshark and hit Alt-Enter. This captures the window to your clipboard. Paste it into your homework.
In: Computer Science
In Unity with C#, I need to implement a dice simulator in my character generator(D&D). I have 6 sides of UI images(2D). With my code, I am able to roll and get the number in my console text(randomly).
But, I need help for rolling 5 dices, not the 1 dice. Also, I need to add all the three highest rolls with 5 dices and get a result in my display.
Ex) 1. Players must roll 5d6 and add the three highest rolls to compute each of the six Abilities. Note make all modifiers default to +2.
In: Computer Science
Must be in C++ and we can not use STR[] we must use STR.at()
Write a program that:
Example 1:
Enter name: Grace Hopper Index of last character: 11 Last 3 characters of first name: ace First 3 characters of last name: Hop
Example 2:
Enter name: Dorothy J. Vaughan Index of last character: 17 Last 3 characters of first name: thy First 3 characters of last name: Vau
This is my code:
#include <iostream>
#include <string>
using namespace std;
int main()
{
string userFirstname;
string userLastname;
string userMiddlename;
cout << "Enter Name: ";
cin >> userFirstname;
cin >> userMiddlename;
cin >> userLastname;
cout << userFirstname << userMiddlename
<< userLastname << endl;
cout << "Index of last character: ";
cout << ((userFirstname.size() +
userLastname.size()) - 1);
cout << endl;
cout << "Last 3 characters of first name:
";
cout << (userFirstname.at(userFirstname.size() -
3)) << (userFirstname.at(userFirstname.size() - 2)) <<
(userFirstname.at(userFirstname.size() - 1)) << endl;
cout << "First 3 characters of last name:
";
cout << userLastname.at(1) <<
userLastname.at(2) << userLastname.at(3) << endl;
return 0;
}
In: Computer Science
Create a Java to find the GCD of two numbers. You will need to create a new variable to reflect the algorithm (numberOne, numberTwo, GCD = 0).
Requirements:
1) read in numberOne
2) read in numberTwo.
3) run the loop, If numberTwo is 0 then print out numberOne, otherwise, temp =numberOne % numberTwo, numberOne = numberTwo, numberTwo = temp.
In: Computer Science
**Add comments to ARM code to explain steps**
Write an ARM assembly program to convert temperatures from Celsius to Fahrenheit or from Fahrenheit to Celsius. Here are the two formulas for your reference. Use variable to read and store values.
C= 5* (F - 32) / 9
F = (9 * C / 5 ) + 32
TempConvert.s
LDR R8,=temperature
LDR R1,[R8]
LDR R8,=unit
LDRB R2,[R8]
LDR R8,=celsius
LDRB R3,[R8]
LDR R8,=fahrenheit
LDRB R4,[R8]
MOV R6,#9
MOV R7,#5
;----C = 5 * (F - 32) / 9
SUB R5,R1,#32
MUL R5,R5,R7
UDIV R5,R5,R6
;------F = (9 * C / 5) + 32
MUL R5,R1,R6
UDIV R5,R5,R7
ADD R5,R5,#32
stop B stop
temperature DCD 50
unit DCB "F",0
celsius DCB "C",0
fahrenheit DCB "F",0
END
In: Computer Science
Give an example of inheritance, you must have a parent and child and test program with at least one variable in each and setters and getters and constructors. The test program must test all the methods.
In: Computer Science