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
Introduction
Introduction to Data Structures programming assignments can be completed either in C++ (preferred) or in Java. In both cases you cannot use libraries or packages that contain pre-built data structures, other than built-in support for objects, arrays, references, and pointers.
Classes in C++ and Java can represent anything in the real world. This assignment is to write a compiler for Z++ programming language.
The Z++ Programming Language
Your program will test if an expression entered by the application user is valid under the Z++ programming language. Therefore, you need to know a little bit about the Z++ programming language (which of course doesn't really exist, not yet anyway).
The Z++ programming language uses only 6 characters, left and right brackets, parentheses and curly braces: { [ ( } ] ). A left curly brace, bracket or parentheses is referred to as a left character. A right curly brace, bracket or parentheses is referred to as a right character.
A Z++ expression is valid if each left character in the expression "matches" with a corresponding right character in the expression. The test for a match requires going left to right through an expression, character by character. When a right character is encountered, then it is compared to the rightmost left character that was not previously compared to a right character. If the characters match, such as { and }, [and ], or ( and ), then you continue through the expression, comparing each right character to the rightmost left character that was not previously compared to a right character, until either the left and right characters don't match (which means the expression is not valid) or there are no more right characters. When there are no more right characters, if all of the left characters have previously been compared to a right character, the expression is valid. However, if there still are left characters that have not previously been compared to a right character, the expression is invalid.
Let's look at some examples. The following expressions are valid:
[]{}()
{([])}
()[{}]
[{}()]
Note that the matching may be by the right character immediately following the left character, by nesting, or by a combination of the two.
However, the expression [({})) is not valid as [ does not correspond to ). Additionally, the expression ([{}()] is not valid. Even though each right character is matched by a left character, the first left character is left over after you have run out of right characters.
Program Description
Your program, which will be written in C++, not Z++, will prompt the user to enter a string of not more than 20 characters. You may use a character array, a C-string or the C++ string class; the choice is up to you. You can assume the user enters no more than 20 characters (though the user may enter less than 20 characters) and the characters entered are limited to left and right brackets, parentheses and curly braces; you do not need to do any error-checking on this. After the user ends input, by the Enter key, the program checks if the string is a valid Z++ expression, and reports that it either is or isn't. Sample outputs:
Enter an expression: []{}()
It's a valid expression
Enter an expression: ()[{}]
It's a valid expression
Enter an expression: [({)}]
It's NOT a valid expression
Stack Class
Module #3 (http://www.agazaryan.com/csit836/stack.html), which accompanies this assignment, explains a stack and how it will be represented by a class having the member variables and member functions (including a constructor) appropriate for a stack.
Multiple Files
The class will be written using header and implementation files. Your program also will include a driver file, so your multi-file project will have three files:
File Name | Purpose |
cstack.h | Header file for stack |
cstack.cpp | Implementation file for stack |
test.cpp | Driver file |
Module #3 (http://www.agazaryan.com/csit836/stack.html) gives you the test.cpp file and all the information necessary to write the cstack.h file. Your job is to write the cstack.cpp file. All class members (variables and functions) must be private unless they need to be public.
In: Computer Science
For each of the three organizations below,
Organizations:
In: Computer Science
Why is it important for software developers to invent products that have greater usability? write in about 500 words
In: Computer Science