For this assignment, create a presentation in PowerPoint, or other presentation software, that discusses the following:
A family member asks what kind of printer they should get for their home system. In a presentation, go over the different options they may have and how it would work for them. What questions should you ask them so you can formulate an adequate answer? Don't forget online options (cloud printing) for the answers you give. Also, give a best guess at cost for them to purchase and run the printer for a period of a year.
This assignment should be a minimum of 10 slides in length (not counting title or references slides)
In: Computer Science
try to find articles that deal with server roles and issues that came up when roles were not properly assigned. You could also find some article that discusses any service that is worth running on a server to help administration or troubleshooting.
In: Computer Science
Given a memory address of 34Ah (10 bits) with 4 memory banks. Determine the memory bank address and the address of the word in the bank using Low Order Interleaving (LOI).
In: Computer Science
C Programming Language Please
Given a string S and keyword string K, encrypt S using keyword Cipher algorithm.
Note: The encryption only works on alphabets. Numbers and symbols such as 1 to 9, -, &, $ etc remain unencrypted.
Input:
Zombie Here
secret
where:
Output:
ZLJEFT DTOT
Explanation: We used "secret" keyword there.
In: Computer Science
Read the input one line at a time until you have read all lines. Now output these lines in the opposite order from which they were read..
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class Part12 {
/**
* Your code goes here - see Part0 for an example
* @param r the reader to read from
* @param w the writer to write to
* @throws IOException
*/
public static void doIt(BufferedReader r, PrintWriter
w) throws IOException {
// Your code goes here - see Part0
for an example
}
/**
* The driver. Open a BufferedReader and a PrintWriter,
either from System.in
* and System.out or from filenames specified on the
command line, then call doIt.
* @param args
*/
public static void main(String[] args) {
try {
BufferedReader
r;
PrintWriter
w;
if (args.length
== 0) {
r = new BufferedReader(new
InputStreamReader(System.in));
w = new PrintWriter(System.out);
} else if
(args.length == 1) {
r = new BufferedReader(new
FileReader(args[0]));
w = new PrintWriter(System.out);
} else {
r = new BufferedReader(new
FileReader(args[0]));
w = new PrintWriter(new
FileWriter(args[1]));
}
long start =
System.nanoTime();
doIt(r,
w);
w.flush();
long stop =
System.nanoTime();
System.out.println("Execution time: " + 1e-9 * (stop-start));
} catch (IOException e) {
System.err.println(e);
System.exit(-1);
}
}
}
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
public class Part0 {
/**
* Read lines one at a time from r. After reading all
lines, output
* all lines to w, outputting duplicate lines only
once. Note: the order
* of the output is unspecified and may have nothing to
do with the order
* that lines appear in r.
* @param r the reader to read from
* @param w the writer to write to
* @throws IOException
*/
public static void doIt(BufferedReader r, PrintWriter
w) throws IOException {
Set<String> s = new HashSet<>();
for (String line = r.readLine(); line != null; line =
r.readLine()) {
s.add(line);
}
for (String text : s) {
w.println(text);
}
}
/**
* The driver. Open a BufferedReader and a PrintWriter,
either from System.in
* and System.out or from filenames specified on the
command line, then call doIt.
* @param args
*/
public static void main(String[] args) {
try {
BufferedReader
r;
PrintWriter
w;
if (args.length
== 0) {
r = new BufferedReader(new
InputStreamReader(System.in));
w = new PrintWriter(System.out);
} else if
(args.length == 1) {
r = new BufferedReader(new
FileReader(args[0]));
w = new PrintWriter(System.out);
} else {
r = new BufferedReader(new
FileReader(args[0]));
w = new PrintWriter(new
FileWriter(args[1]));
}
long start =
System.nanoTime();
doIt(r,
w);
w.flush();
long stop =
System.nanoTime();
System.out.println("Execution time: " + 1e-9 * (stop-start));
} catch (IOException e) {
System.err.println(e);
System.exit(-1);
}
}
}
In: Computer Science
Write the steps to use the vi editor command to create myfile. Insert the following lines of text save and display the result to STDOUT with cat command. line 5 line 6 line 3 line 2
In: Computer Science
I am trying to write a python code to create a function that returns all possible dimensions (reshaping) for an input matrix, can someone explains the math and write a python code with explaining all the steps and give me a test cases, and please explain if there is more than one approach. so if we have 1*8 matrix we should return 1*8, 2*4,4*2,8*1
def reshaping(M) should return a n ORDERED list AND the all possible reshaped matrices
In: Computer Science
#include <iostream>
using namespace std;
string* callMe(string*& s){
static string* str = new string{"Chiqita Banana"};
str = s;
return str;
}
int main()
{
string* s = new string{"Hey Google"};
string* str = callMe(s);
cout << "Call me \'" + *str +"\'";
return 0;
}
1. What is the output or the error of this program?
Call me 'Hey Google'
2. And please explain the data flow in detail (to memory level)?
Please help question 2 with explanation, thank you!
In: Computer Science
You are given two classes for implementing a simple binary tree of capable of storing number, count the number of leaves and computes the height of a binary tree.
You can add on additional parameters or functions as you wish, but the program must apply the chapter objectives.
class BTreeNode { //node for the binary tree items
public:
BTreeNode(double x, BTreeNode *leftp = NULL, BTreNode *rightp = NULL) {
value = x;
left = leftp;
right = rightp;
}
private:
double value;
BTreeNode *left, *right;
friend class BST; //BST has friend status
};
class BST { //binary tree class
public:
int height() { //returns the tree height
return height(tree);
}
void insert(double x); //inserts numbers into the binary tree
void inorder(vector<double> &v) { //appends all nodes in subtree
inorder(v, tree);
}
int leafCounter() { //counts the number of leaves
return leafCounter(tree);
}
BST() {
tree = NULL;
}
private:
void inorder(vector<double>&tlist, BTreeNode *t); //storing nodes in a subtree
int leafCounter(BTreeNode *t); //counts the number of leaves
static int height(BTreeNode *t); //calculates the height of the tree
BTreeNode *tree;
}
In: Computer Science
hello please correct this code
print("The Miles Per Gallon program") print() Trips = [] trip = 0 while 1: print("Do you want to add a trip from a csv file or Enter it manually? 1 for csv 2 for entering it manually") method = int(input()) if method == 1: print("Enter the filename") fileName = input() try: with open(fileName, 'r') as myFile1: reader = csv.reader(myFile1) Trips = list(reader) print("Miles Driven Gallons Used \tMPG") for i in Trips: for j in i: print(j, end=" ") print() except IOError: print ("Could not read file:", fileName) elif method == 2: while 1: miles_driven = input("Enter miles driven: ") try: val = int(miles_driven) break except ValueError: print("No.. input string is not an Integer. It's a string") while 1: gallons_used = input("Enter gallons of gas used: ") try: val2 = int(gallons_used) break except ValueError: print("No.. input string is not an Integer. It's a string") mpg = val / val2 mpg = round(mpg, 2) Trips.append([]) Trips[trip].append(miles_driven) Trips[trip].append(gallons_used) Trips[trip].append(mpg) print("Miles Driven Gallons Used \tMPG") for i in Trips: for j in i: print(j, end= " ") print() trip += 1 choice = int(input("Do you want to add another trip? 1 for yes 0 for no ")) if choice == 1: continue elif choice == 0: break myFile = open('trips.csv', 'w') with myFile: writer = csv.writer(myFile) writer.writerows(Trips) with open('trips.csv', newline='') as myFile: reader = csv.reader(myFile) for row in reader: print(row) print("Elemnts from the csv file printed which means it was stored successfully")
i need result as
EXAMPLE RUN 1: - Bad filename C:\Files.py The Miles Per Gallon
program
Would you like to read trips from a file? y/n: y Enter the csv
filename containing trip data: test Trips not read from file - file
not found: test Would you like to enter trip data? y/n: y Enter
miles driven: 100 Enter gallons of gas used: 10 1. Miles: 100.0
Gallons of Gas: 10.0 Mpg: 10.0
Would you like to continue? y/n: y Enter miles driven: 50 Enter
gallons of gas used: 5 1. Miles: 100.0 Gallons of Gas: 10.0 Mpg:
10.0 2. Miles: 50.0 Gallons of Gas: 5.0 Mpg: 10.0
Would you like to continue? y/n: n
EXAMPLE RUN 2: Good filename and good inputs
C:\y The Miles Per Gallon program
Would you like to read trips from a file? y/n: y Enter the csv
filename containing trip data: trips.csv Trips: 1. Miles: 100.0
Gallons of Gas: 10.0 Mpg: 10.0 2. Miles: 50.0 Gallons of Gas: 5.0
Mpg: 10.0
Would you like to enter trip data? y/n: y Enter miles driven: 75
Enter gallons of gas used: 4 1. Miles: 100.0 Gallons of Gas: 10.0
Mpg: 10.0 2. Miles: 50.0 Gallons of Gas: 5.0 Mpg: 10.0 3. Miles:
75.0 Gallons of Gas: 4.0 Mpg: 18.75
Would you like to continue? y/n: n
c:\\
EXAMPLE RUN 3: Good Filename – bad user inputs
The Miles Per Gallon program
Would you like to read trips from a file? y/n: y Enter the csv
filename containing trip data: trips.csv Trips: 1. Miles: 100.0
Gallons of Gas: 10.0 Mpg: 10.0 2. Miles: 50.0 Gallons of Gas: 5.0
Mpg: 10.0 3. Miles: 75.0 Gallons of Gas: 4.0 Mpg: 18.75
In: Computer Science
Submission Question 3: Polymorphism
Problem
You are writing software for a company’s human resources department. As part of the requirements, it would like to have a function that calculates the salary of an individual based on the position he or she holds, years of service, and hours worked.
This program will demonstrate the following:
Solving the Problem
Step 1
The first thing that you must determine is what attributes are common to all employees and what methods they can share. Can salary be easily calculated by the same method without some additional input from the user? By using polymorphism, you can make one method that calculates salaries for different groups. First, determine the base class and what method needs to be implemented by the child classes. By making the calcSalary() method abstract, it will be a required method of the child classes.
Step 2
You can then define the child classes that inherit the shared attributes from the base Employee class but also inherit the requirement that they implement from the calcSalary() method. Each employee type will have a different set of attributes and a different method of calculating the salary, but the same method call will be used to calculate it.
Step 3
You can now create a list to hold all employee types and populate it.
Step 4
Because you used polymorphism in the classes, you can now use one loop to calculate and output the salaries of the employees.
Documentation Guidelines:
Use Python Programming. Use good programming style (e.g., indentation for readability) and document each of your program parts with the following items (the items shown between the '<' and '>' angle brackets are only placeholders. You should replace the placeholders and the comments between them with your specific information). Your cover sheet should have some of the same information, but what follows should be at the top of each program's sheet of source code. Some lines of code should have an explanation of what is to be accomplished, this will allow someone supporting your code years later to comprehend your purpose. Be brief and to the point. Start your design by writing comment lines of pseudocode. Once that is complete, begin adding executable lines. Finally run and test your program.
Deliverable(s):
Your deliverable should be a Word document with screenshots showing the source code and running results, and discuss the issues that you had for this project related to AWS and/or Python IDE and how you solved them for all of the programs listed above as well as the inputs and outputs from running them. Submit a cover sheet with the hardcopy of your work.
In: Computer Science
Using Java
Prime numbers. Write a program that prompts the user for an integer and then prints out all prime numbers up to that integer. For example, when the user enters 20, the program should print 2 3 5 7 11 13 17 19 Recall that a number is a prime number if it is not divisible by any number except 1 and itself. Use a class PrimeGenerator with methods nextPrime and isPrime. Supply a class PrimePrinter whose main method reads a user input, constructs a PrimeGenerator object, and prints the primes. Submit the Java file and screenshot of the output in zip file.
In: Computer Science
What advantages does the memory hierarchy provide? Explain.
In: Computer Science
Fill in the classes to represent salaried and hourly employees. Salaried employees are paid for forty hours no matter how much they actually work. Hourly employees are paid their hourly rate up to forty hours of work, and 1.5 times their normal rate for overtime.
Employee.java
public abstract class Employee {
protected double payRate;
public Employee(double payRate) {
this.payRate = payRate;
}
abstract public double computePay(double hours);
}
HourlyEmployee.java
public class HourlyEmployee extends Employee {
public HourlyEmployee(double payRate) {
}
public double computePay(double hours) {
return 0;
}
}
SalariedEmployee.java
public class SalariedEmployee extends Employee {
public SalariedEmployee(double payRate) {
}
public double computePay(double hours) {
return 0;
}
}
In: Computer Science
Using a pseudocode example, explain the wait and signal operations of a binary semaphore.
In: Computer Science