1 2 3 5 6 7 8 10 12 13 15 16 18 19 20 22 40
In: Computer Science
Write a program that asks the user for 10 integers, then prints all integers, followed by the largest integer.
CPP. ONLY!!
In: Computer Science
This is C++. I would like to know the TODO list comments.
#include <cstdlib>
#include <iostream>
// TODO: 2. (1 point) Declare your Acker function prototype
below:
// When done, commit with the commit message that follows,
being
// sure to delete all these TODO instructions before
actuallly
// executing the git commit command.
//
// CSC232-HW02 - Added Aker function prototype.
//
// Don't forget to fully document the function prototype
using
// all the appropriate doxygen elements.
/**
* @brief Entry point to this application.
* @remark You are encouraged to modify this file as you see fit to
gain
* practice in using objects.
*
* @param argc the number of command line arguments
* @param argv an array of the command line arguments
* @return EXIT_SUCCESS upon successful completion
*/
int main(int argc, char **argv) {
// TODO: 4. (0.5 points) Replace *** text ***
with actual call to Acker
// function. When done, commit with the commit
message that follows,
// being sure to delete all these TODO
instructions before actuallly
// executing the git commit command.
//
// CSC232-HW02 - Display calculated Acker
value.
//
std::cout << "Acker(1, 2) = " <<
"*** replace me with call to Acker***"
<<
std::endl;
return EXIT_SUCCESS;
}
// TODO: 3. (2 points) Define the Acker recursive function below.
When done,
// commit with the commit message that follows, being sure to
delete
// all these TODO instructions before actually executing the
git
// commit command.
//
// CSC232-HW02 - Implemented Acker function.
// TODO: 5. (1 point) Do a box trace of Acker(1, 2) using pen and
paper.
// Hand this in at the beginning of class on Friday, 17 February
2017.
// Your solution MUST be legible; no points are assigned to
illegible
// papers.
This is testRunner.
#include <cppunit/BriefTestProgressListener.h>
#include <cppunit/CompilerOutputter.h>
#include <cppunit/extensions/TestFactoryRegistry.h>
#include <cppunit/TestResult.h>
#include <cppunit/TestResultCollector.h>
#include <cppunit/TestRunner.h>
#include <cppunit/Test.h>
#include <cppunit/TestFailure.h>
#include <cppunit/portability/Stream.h>
/**
* @brief Main test driver for CPPUNIT test suite.
* @remark DO NOT MODIFY THE SPECIFICATION OR IMPLEMENTATION OF THIS
CLASS! ANY
* MODIFICATION TO THIS CLASS WILL RESULT IN A GRADE OF 0 FOR THIS
LAB!
*/
class ProgressListener : public CPPUNIT_NS::TestListener {
public:
ProgressListener()
: m_lastTestFailed(false) {
}
~ProgressListener() {
}
void startTest(CPPUNIT_NS::Test *test) {
CPPUNIT_NS::stdCOut()<< test->getName();
CPPUNIT_NS::stdCOut()<< "\n";
CPPUNIT_NS::stdCOut().flush();
m_lastTestFailed =
false;
}
void addFailure(const
CPPUNIT_NS::TestFailure& failure) {
CPPUNIT_NS::stdCOut()<< " : " << (failure.isError() ?
"error" : "assertion");
m_lastTestFailed =
true;
}
void endTest(CPPUNIT_NS::Test *test) {
if
(!m_lastTestFailed)
CPPUNIT_NS::stdCOut() << " : OK";
CPPUNIT_NS::stdCOut()<< "\n";
}
private:
/// Prevents the use of the copy
constructor.
ProgressListener(const ProgressListener&
copy);
/// Prevents the use of the copy operator.
void operator=(const ProgressListener&
copy);
private:
bool m_lastTestFailed;
};
int main() {
// Create the event manager and test
controller
CPPUNIT_NS::TestResult controller;
// Add a listener that colllects test
result
CPPUNIT_NS::TestResultCollector result;
controller.addListener(&result);
// Add a listener that print dots as test
run.
ProgressListener progress;
controller.addListener(&progress);
// Add the top suite to the test runner
CPPUNIT_NS::TestRunner runner;
runner.addTest(CPPUNIT_NS::TestFactoryRegistry::getRegistry().makeTest());
runner.run(controller);
// Print test in a compiler compatible
format.
CPPUNIT_NS::CompilerOutputter
outputter(&result, CPPUNIT_NS::stdCOut());
outputter.write();
return result.wasSuccessful() ? 0 : 1;
}
In: Computer Science
What kinds of systems might be valuable targets in information warfare? Create a prioritized list of targets and describe the kinds of damage that could result if these systems were attacked. Provide a minimum of 3 paragraphs.
In: Computer Science
pseudocode
display "Please enter first name: " input fName display "Please enter middle initial (Enter space if none): " input mName display "Please enter last name: " input lName display "Enter hours worked: " input hours display "Enter hourly rate: " input perHourRate weeklySalary = hours * perHourRate output "fName mName. lName" output weeklySalary
Question 1. Move your algorithm/pseudocode/outline into Code:Blocks and create a "shell" program. (The shell program shouldn't do any of the final work, but it should have comments where the final code will go and should compile and run.)
In: Computer Science
If you were designing sound for a game, in what instances would you create your own sounds using foley (or by recording sounds from the environment) versus utilizing pre-existing material from a library? Similarly, when would you create (or hire someone to create) original music versus licensing pre-existing material from a library or label?
In: Computer Science
In C Sharp with the use of the Try and Catch method create an application that displays the contents of the Teams.txt file in a ListBox control. When the user selects a team in the ListBox, the application should display the number of times the team has won the World Series in the time period from 1903 through 2012.
Teams.txt--This file contains a list of several Major League baseball teams in alphabetical order. Each team listed in the file has won the World Series at least once.
WorldSeriesWinners.txt - This file contains a chronological list of the World Series' winning teams from 1903 through 2012. (The first line in the file is the name of the team that won in 1903, and the last line is the name of the team that won in 2012. Note that the World Series was not played in 1904 or 1994.)
Hint: Read the contents of the WorldSeriesWinners.text file into a List. When the user selects a team in the ListBox, the application should display the number of times the selected team appears.
In: Computer Science
Java program code: InventoryManager
For this assignment, you will be creating an inventory manager for a store that sells vegetables. The inventory will be managed using arrays.
The required name for the project is
InventoryManager.
The required name for the Java file is
InventoryManager.java.
The required main class name is
InventoryManager.
Part 1: Planning the store
Decide the name of your store. Place this name in a constant
called STORE_NAME.
As soon as the program starts, display a greeting to the user to
let them that they have begun using the inventory management app
for this store.
Then, perform the following:
The following table is just one example of the values that might populate the three arrays. Each index represents one single item.
| INDEX | 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|---|
| items array | onion | broccoli | carrot | zucchini | cucumber |
| quantities array | 12 | 4 | 3 | 56 | 30 |
| prices array | 1.52 | 0.53 | 1.25 | 1.34 | 2.32 |
NOTE: Apart from the items array, these are just example
values. Because the user is required to enter these values, values
in quantities and prices could be
anything.
If we were to determine the quantity of our carrots, we would first find that "carrot" is located at index 2 in items, so we would retrieve the value in quantities at index 2, which is a quantity of 3. To find the price, we would retrieve the value at index 2 of prices, which is 1.25.
Make sure you use the appropriate datatype for each array (int? double? String?)
All of the previous directions take place only at the beginning of the program. You can think of it as the set up for the main part of the program. Once done, the user will be taken into Part 2 of this assignment.
Part 2: Operating the InventoryManager
Display to the user the possible operations on the inventory and prompt him/her to choose one. The user should select the option by entering its number. Every time the user completes one of the operations (except for Exit), the user should be taken back to this screen where they can choose from this list again. If Exit is selected, the user should be given a message thanking them for using the program, and then the program should be properly closed. Do not use System.exit() to close the program. You must exit the program by exiting the loop itself.
There are 5 possible operations:
1. Print inventory
2. Check for low inventory
3. Highest and lowest inventory value items
4. Total inventory value
5. Exit
1. Print inventory
This operation prints all the inventory items, with each item shown in the following format:
Item: ITEM-NAME
Quantity: ITEM-QUANTITY
Price: ITEM-PRICE
Total value: TOTAL-VALUE
ITEM-NAME should be replaced by the name of the
item.
ITEM-PRICE should be replaced by the price of the
item.
TOTAL-VALUE should be replaced by the total price
if someone were to purchase the entire stock of items.
Make sure your output appears exactly like the format above. You should print the information for all five items in an efficient way (using a loop).
Once this is done, the user should be allowed to select one of the five options from the original menu.
2. Check for low inventory
This operation checks for items that have a quantity of less than 5, then prints them in the same format as in option 1.
If there is no such item whose quantity is less than 5, then display a message that explains that to the user.
Once this is done, the user should be allowed to select one of the five options from the original menu.
3. Highest and lowest inventory value items
This operation finds the following two items:
Remember that the total inventory value is the value of the whole stock of the inventory item combined, which would be equal to the quantity multiplied by the price.
If two or more items have a matching inventory value and they are either the highest or lowest, then you only need to display one of them.
Display the highest and lowest inventory value items in the same way as option 1.
Once this is done, the user should be allowed to select one of the five options from the original menu.
4. Total inventory value
This is the total value of ALL items in the store, taking into account the quantity of each item. Display this value to the user.
Once this is done, the user should be allowed to select one of the five options from the original menu.
5. Exit
If selected, the user should be given a message thanking them for using the program, and then the program should exit. Do not use System.exit() to exit the program. You must exit the program by logically ending the loop.
Requirements
When this program runs, it should be obvious to the user the values they are seeing. Include all units when displaying values. For example, when displaying dollar values, make sure you include a dollar sign ($). You do not need to worry about making two decimal digits show when displaying dollar values. For example, it's okay to display $4.5 instead of $4.50.
In: Computer Science
I need to answer all 16 questions. Please do as many as you can.
Please answer the following question of database
management.
1. Describe the process of creating a table in SQL and the
different data types you can use for fields.
2. What is the purpose of the WHERE clause in SQL? Which
comparison operators can you use in a WHERE clause?
3. How do you write a compound condition in an SQL query? When is a
compound condition true?
4. What is a computed field? How can you use one in an SQL query? How do you assign a name to a computed field?
6. How do you use the IN operator in an SQL query?
7. How do you sort data in SQL? When there is more than one sort key, how do you indicate which one is the major sort key? How do you sort data in descending order?
8. What are the SQL built-in functions? How do you use them in an
SQL query?
9. What is a subquery? When is a subquery executed?
10. How do you group data in SQL? When you group data in SQL, are
there any restrictions on the items that you can include in the
SELECT clause? Explain.
11. How do you join tables in SQL?
12. In a complex join, how is the number of tables you wish to join related to the number of WHERE conditions?
13. How do you qualify the name of a field in an SQL query? When is it necessary to do so?
14. How do you take the union of two tables in SQL? What criteria must the tables meet to make a union possible?
15. Describe the three update commands in SQL.
16. How do you save the results of an SQL query as a table?
In: Computer Science
"Write a function named "firstLast2" that takes as input a vector of integers. The function should return true if the vector starts and ends with the digit 2. Otherwise, it should return false. Test your function with vectors of different length and with the digit 2 at the beginning of the vector, end of the vector, middle of the vector, and missing from the vector."
Additional Requirements:
>Must use a loop allowing the user to continue until he/she quits.
>Read the full name, middle (if there is any) and last name separately.
>Must work even if there is no middle name.
In: Computer Science
Write a MARIE program that asks the user for a beginning and an ending address of an array in the memory and checks whether the sequence of integers in between these memory locations is a palindrome. Output 1 on the screen if you conclude it is a palindrome. Add comments to your program.
In: Computer Science
2.
a. Choose all of the following that apply to DynamoDB:
(a) DynamoDB is part of RDS
(b) Is stored in 3 different locations
(c) Does not support joins, foreign keys and complex queries
(d) Supports Local and Global secondary indexes
(e) Users can manage DynamoDB in the backend (add CPU, memory, etc)
(f) Utilizes partition key to spread data across partitions for scalability
b. Which of the following standard is used by MongoDB to store documents internally?
(a) BSON
(b) JSON
(c) Extended JSON
(d) SQL
In: Computer Science
I asked this question before, but I'm wondering if there are any other ways to do this problem. My exam will be similar to this, so I'm looking for more examples to study with. Thank you!
For this Java program, you will write two classes: GradeCalculator and GradeCalculatorDriver.
In the GradeCalculator class, compute the final average and letter grade for a particular student.
The final average is calculated according to the following rules:
1) There are ten exams scored out of 100 points
2) The lowest exam score is not included in the calculation of the final average
3) The highest exam score is not included in the calculation of the final average
4) An average of 91-100 is an A
5) An average of 81-90 is a B
6) An average of 71-80 is a C
7) An average of 61-70 is a D
8) An average of 0-60 is an E
The GradeCalculator class must include the following methods:
1) A method to compute and return the highest score
2) A method to compute and return the lowest score
3) A method to compute the sum of all the scores
4) A method to compute the final average
5) A method to determine the letter grade
In the GradeCalculatorDriver class, include a main method that asks the user for the student’s name and their ten exam grades, reads the grades, calculates the letter grade and prints it. This process should be repeated until the user enters N.
For example, a run of the program might look something like this:
Welcome to Score Calculator
Want to compute a final average? Y
Please enter the student’s name: Sara Smith
Please enter test scores all on one line separated by one or more spaces.
The final score for Sara Smith is 100.
The letter grade for Sara Smith is A.
Want to compute another final average? N
In: Computer Science
Can you please Describe your actions as the Manager, and how you would manage the project team's stress levels? but meeting the required dates.
Can you please Describe in detail, how dealing with short deadlines??..... will need to be compensated in the teams focus ?as well as how you will ensure that this is accomplished?
***(G) Greenberg, Jerald and Baron, Robert, Behavior in
Organizations, 10th Edition, Prentice Hall, Upper Saddle River, NJ
2008. ISBN 9780136090199.
***(H) Humphrey, Watts S., Managing Technical People,
Addison-Wesley, Reading, MA 1997. ISBN 9780201545975
***Please use the book resource if you can ? and APA for another website resource,
*250 words response please!
In: Computer Science