How do I create a backup and restore strategy for a web site and the database for the site?
In: Computer Science
Suppose you have algorithms with the five running times listed below.
(Assume these are the exact running times.)
How much slower (i.e., you need check the ratio) do each of
these algorithms get when
you (a) double the input size, (b) increase the input size by
one?
5nlog(n)
In: Computer Science
PLEASE ANSWER
USING C#
Is there a Prius version? Did you know that the average Boeing 747 airplane uses approximately 1 gallon of fuel per second? Given the speed of the airplane, that means it gets 5 gallons to the mile. No, not 5 miles to the gallon, 5 gallons to the mile. You may be questioning why such a horribly inefficient machine is allowed to exist, but you’ll be happy to find out that, because this airplane hold 568 people, it averages about 0.01 gallons per person – (100 miles per gallon per person). Your job is to design (pseudocode) and implement (source code) a program that asks the user for a distance the plane has to fly (i.e. the length of the trip) and also asks the cost of jet fuel (which is currently $1.80 per gallon). The program should then calculate the total fuel charges to make the trip. Next, ask the user how many people will fly, as well as the average cost of a ticket. Finally, print the total profit made (or lost) and the average gas mileage per person. Document your code and properly label the input prompts and the outputs as shown below.
Sample run 1:
Enter the flight distance: 1000
Enter the current cost of jet fuel: $2 The flight will cost $10000.0 in fuel.
Enter the number of passengers: 5
Enter the average cost of a ticket: 1000
You will make a profit of $-5000.0
You averaged 1.0 miles per person per gallon!
In: Computer Science
Write a program that generates a random number between 1 and 50 and asks the user to guess it. As a hint, it tells the user how many divisors it has, (excluding 1 and the number itself). Each time the user makes a wrong guess, it displays "Wrong" and says if the guess was too low or too high, until the user gets it right, in which case it says "Right" and says how many trials it took to guess it. Then, the program asks the user if he or she wants to continue. If the answer is 'y' or 'Y', it generates another number between 1 and 50 and repeats the game. If not, it prints the average of all trials with one decimal place and ends.
Example:
I've picked a number between 1 and 50 that has 0 divisor(s).
Guess the number: 23
Too low!
Guess the number: 37
Too low!
Guess the number: 43
Too high!
Guess the number: 41
Right! It took you 4 trials.
Play again? [y/n]: y
I've picked a number between 1 and 50 that has 1 divisor(s).
Guess the number: 25
Too low!
Guess the number: 49
Right! It took you 2 trials.
Play again? [y/n]: y
I've picked a number between 1 and 50 that has 3 divisor(s).
Guess the number: 30
Too high!
Guess the number: 24
Right! It took you 2 trials.
Play again? [y/n]: n
You averaged 2.7 trials in 3 games.
Press any key to continue.
Im stuck with the loops and if you can explain the steps would be great. At the end I need to show the average in where the user guessed the correct number and how many games they played
In: Computer Science
The Instructor class consists of a firstname (String), lastname (String), office building (String) and room number (int). There is a no-arg constructor that initializes the properties to “Albert”, “Einstein”, “McNair”, 420. There is also a constructor with a parameter for each class property. Finally, there is a toString() method that returns each property separated by an asterisk * .
Problem 2 (5 points)
The Textbook class consists of a title (String), publisher (String) and edition (int). There is a no-arg constructor that initializes Strings to “” and numeric values to zero. A second constructor has formal parameters for each property. The class toString() method returns a String with each property separated by a System.lineSeparator() char.
Problem 3 (5 points)
The Course class consists of a name (String), semester (String), instructor (Instructor) and textbook (Textbook). As with the previous classes, there are two constructors: one no-arg constructor and one constructor with formal parameters for each property. The no-arg constructor initializes reference variables to null. The toString() method separates the name and semester by a comma (‘,’). There is a System.lineSeparator() char after the semester property and between the Instructor and Textbook properties. The Instructor and Textbook properties are formatted using the toString() method from their respective classes.
Problem 4 (5 points)
if you could show which part was based off of which problem, that would be helpful.
In: Computer Science
Create a Java class named ReadWriteCSV that reads the attached
cis425_io.txt file that you will save in your workspace as
src/cis425_io.txt and displays the following table:
--------------------------
| No | Month Name | Days |
--------------------------
| 1 | January | 31 |
| 2 | February | 28 |
| 3 | March | 31 |
| 4 | April | 30 |
| 5 | May | 31 |
| 6 | June | 30 |.
| 7 | July | 31 |
| 8 | August | 31 |
| 9 | September | 30 |
| 10 | October | 31 |
| 11 | November | 30 |
| 12 | December | 31 |
--------------------------
Write that file out in reverse order to a file named:
src/cis425_ior.txt
public class ReadWriteCSV {
// Put class properties here
// Add method, processInfile(), to open file and read here
void processInfile()
{
File filename = new File
("cis425_io.txt");
Scanner in = new
Scanner(System.in); // System.in is an InputStream
Scanner inFile = new
Scanner("cis425_io.txt");
}
// add method, displayTable(), here to display the table
void displayTable() {
}
// add method, writeOutfile(), here to open and write the data in
reverse order to the new file
void writeOutfile() {
}
// add main() method here
public static void main(String[] args) {
}
}
In: Computer Science
use C++
You will implement the following encryption and decryption functions/programs for the Caesar cipher. Provide the following inputs and outputs for each function/program:
EncryptCaesar
Two inputs:
A string of the plaintext to encrypt
A key (a number)
▪ For the Caesar cipher: This will indicate how many characters to shift (e.g. for a key=3, A=>D, B=>E, ..., X=>A, Y=>B, Z=>C). Note that the shift is circular.
One output:
◦ A string of the ciphertext or codeword
DecryptCaesar
Two inputs:
◦ A string of the ciphertext to decrypt ◦ The key (a number)
One output:
◦ A string of the plaintext
Obviously, for this assignment to be successful, the decryption function/program must decrypt the original message which was encrypted by the encryption function/program. Or, for a plaintext P and an encryption function E() and a decryption function D(), P = D( E(P, Key), Key)
In: Computer Science
Create the appropriate variables and algorithm to calculate the following. Choose your own values for the variables. Do not enter the code on this paper. Create a program that calculates and displays the calculation. Approximate pi (π) as 3.14159.
You do not need to create a new program for each question.
If certain math equations use the same variable name, then you only need to declare it once in your main function.
Separate each problem using comments, like seen in the example below.
Example 1: Area of a square/rectangle. Formula:
int main()
{
// Example 1
float area, length, width;
length = 20;
width = 5;
area = length * width;
cout << "The area of a square with length " << length << " and width "
<< width << " is " << area << " square units.";
// Problem 1
// Problem 2
return 0;
}
In: Computer Science
int a = 1;
int b = 2;
if (a<b)
a=a+1;
b = b + a;
printf("The value of b is: %d", b);
int a = 2;
int b = 2;
if (a<b)
a=a+1;
else
a=a-1;
b = b + a;
printf("The value of b is: %d", b);
In: Computer Science
Suggest ways how to increase the number of visits for a website?
In: Computer Science
c programming
Proxy IP addresses and port number are following [Ref-1]
191.96.43.58:3129
136.25.2.43:49126
198.211.96.170:3129
198.1.122.29:80
Note: THE STRING FORMATE IS "IP_Address:Port_Number ". For example, "191.96.43.58:3129" includes an IP address and a port number. "191.96.43.58" is the IP address; "3129" is the port number.
Write a program using C Structures.
If port number is 3129, please identify these IP addresses.
In: Computer Science
Let t = [1:60];
x = [68 126 86 71 100 177 233 271 206 269 340 269 315 384 431 467 382 440 511 558 565 529 511 551 682 665 642 671 796 774 749 758 796 834 878 896 847 836 872 925 978 981 989 1041 1070 1067 1138 1167 1167 1167 1167 1194 1245 1196 1167 1165 1167 1196 1167 1134];
y =-[238 226 189 238 295 231 184 240 289 235 195 231 295 249 184 189 244 291 246 233 193 193 246 289 115 35 273 298 111 33 44 286 280 242 238 193 191 242 291 271 184 293 233 182 211 289 242 209 80 160 278 298 246 298 275 206 155 153 157 162];
1. Use cubic splines with clamped conditions to fit the data t and y.
2. Let tt=linspace(t(1),t(end),200); and evaluate the cubic spline at tt and assign the result to a variable called y1.
3. Find spline (from 1) at 45.
4. Use cubic splines with not-a-knot conditions to fit the data t and x.
5. Let tt=linspace(t(1),t(end),200); and evaluate the cubic spline at tt and assign the result to a variable called x1.
6.Plot the x1 (from part 5) against y1 (from part 2). Describe the resulting plot and show your MATLAB code and plots.
In: Computer Science
Q: Provide JavaScript code to change the font family of the first h1 heading in the document to Arial?
In: Computer Science
Show the code in matlab to display an ECG graph
(I do not want code that simply calls the ecg function in matlab
but how to write that kind of code)
In: Computer Science
A plant manager is considering buying additional stamping machines to accommodate increasing demand. The alternatives are to buy 1 machine, 2 machines, or 3 machines. The profits realized under each alternative are a function of whether their bid for a recent defense contract is accepted or not. The payoff table below illustrates the profits realized (in $000's) based on the different scenarios faced by the manager.
Alternative Bid Accepted Bid Rejected
Buy 1 machine $10 $5
Buy 2 machines $30 $4
Buy 3 machines $40 $2
Refer to the information above. Assume that based on historical bids with the defense contractor, the plant manager believes that there is a 65% chance that the bid will be accepted and a 35% chance that the bid will be rejected.
a. Which alternative should be chosen using the expected monetary value (EMV) criterion?
b. What is the expected value under certainty?
c. What is the expected value under perfect information (EVPI)?
(I need an Excel Spreadsheet)
In: Computer Science