State the advantages and disadvantages of using a virtual private network
In: Computer Science
Hand encode the following Micro Blaze instructions, give your answer in hexadecimal
a) Use ADDI to add the constant value $2AB3 from R6 and save the result to R7 b) Use the ADDC instruction to add the contents of registers R8 and R9, then save the sum in register R10 c) Use IMM and LWI to read a value from memory, starting with the base address $003B35A3, using an offset stored in R8, and having the value read into R9In: Computer Science
Make a program to simulate the end of the world as we know, containing the following features: NEEDED IN C++.
The world population according to all sci-fi movies will perish up to a certain percentage, given global: (a) earthquakes 10%, (b) tsunamis 20%, (c) volcanoes 10%, (d) freezing temperature from sudden ice age 10%, (e) crashing meteorites 10%, (f) widely spread fires 10%, (g) hunger 10%, (h) zombies 10%, and (i) hurricanes 10%;1) Implement a classnamed World; Class Worldinherited the Class CRandom;
2) In the Class Worldcreate methods named EarthQuakes; Tsunamis; Volcanoes; IceAge; Meteorites; Fires; Hunger; Zombies; and Hurricanes; Those methods are used to return/inform the death toll (in numbers and percentage) caused according to the respective event uniform probability: e.g. tsunamis rangeLow is 0 and rangeHigh is 20%;
3) The methods created in the previous step (item 2), should use the inherited Class CRandomto obtain the expected random probability;
4) In the Class World create a method named TotalSurvivorsthat informs in percentage what is the final earth's population that survived the Apocalypse/armageddon, compared with its current population currently estimated as 7 Billion;
5) In the Class World create a method named NewWorldthat will print the message: “Happy Ending! Total number of Survivors is: .... ”, if there is no survivors, then print the message: “No Happy Ending! There are no survivors.”
In: Computer Science
Write a C program without using if-else construct that does the following. It accepts a sequence of positive integers between 1 and 9 both inclusive from the keyboard. The program will stop accepting input once an integer outside the range is entered. The program will finish by printing the total number multiples of 3 and total number of even integers entered. Test data and expected output: Enter integers between 1 & 9 both inclusive, outside range to stop Enter integer :0 Total no of even integer entered is 0 Total no of multiples of 3 entered is 0 Enter integers between 1 & 9 both inclusive, outside range to stop Enter integer :2 Enter integer :4 Enter integer :6 Enter integer :9 Enter integer :3 Enter integer :1 Enter integer :2 Enter integer :0 Total no of even integer entered is 4 Total no of multiples of 3 entered is 3
In: Computer Science
Explain why the reliability of a system is not static but dynamic.?
In: Computer Science
. Fibonacci sequence Fn is defined as follows: F1 = 1; F2 = 1; Fn = Fn−1 + Fn−2, ∀n ≥ 3. A pseudocode is given below which returns n’th number in the Fibonacci sequence. RecursiveFibonacci(n) 1 if n = 0 2 return 0 3 elseif n = 1 or n = 2 4 return 1 5 else 6 a = RecursiveFibonacci(n − 1) 7 b = RecursiveFibonacci(n − 2) 8 return a + b Derive the complexity of the above algorithm by writing the recurrence and solving it. Use the memoization idea (of dynamic programming) to obtain a linear time algorithm for the above problem. Show Pseudo-code and complexity proof. (5 + 10)
In: Computer Science
Create a method called firstLetter that takes a String parameter and integer parameter. It should return -1 if the number of words in the given String is greater than or equal to the integer parameter (it should return -1 and not process the String any further) (4 points). If the String does not have more words than the given integer, the method should return 1 if all the words in the string start with the same letter(8 points) and 0 if all the words do not start with the letter(4 points). (4 points: correct method signature-2 for parameter, 2 for return type) For example, System.out.println(firstLetter("Charlie chews chewy chews.",10)); would print to screen 1 since all words start with the same letter (notice the method is not case sensitive) and the number of words is less than 10.
code in java
In: Computer Science
Design a set of classes that keeps track of demographic information about a set of people, such as age, nationality, occupation, income, and so on. Design each class to focus on a particular aspect of data collection. Assume the input data is coming from a text file. Create a main driver class to instantiate several of the classes.
In: Computer Science
Use adventure works 2014 database to solve the following questions in SQL management studio.
1. Create a stored procedure that will receive parameters (all non-nullable fields should be supplied except the primary key which should be auto created still) to add a customer, single email, and single phone. The procedure should run it's code in a transaction and if any part of the add fails then the transaction should rollback.
2. Provide this query from previous assignments written with an isolation level that won't see your procedure transaction above until it's complete. Using joins List the orders customer name, order status, date ordered, count of items on the order, and average quantity ordered where the count of items on the order is greater than 300.
the data tables for second question are: sales.customer, sales.salesOrderHeader, Person.Person, sales.salesOrderDetail
In: Computer Science
For this final discussion, I would like you to venture out beyond the information presented in this class and find a news article or magazine article (something "current") that is related to a company software upgrade. Identify what software was updated and why, security concerns, etc. Explain how the story or example works in regards to the things we have focused on in this course. Given your newly acquired knowledge on these topics, what stands out to you from this story? Is there anything you feel could have been done better?
In: Computer Science
Write a program to read in a list of domain names from the provided file (domains.dat), and print the reverse domain names in sorted order. For example, the reverse domain of cs.princeton.edu is edu.princeton.cs. This computation is useful for web log analysis. To do so, create a data type Domain, using reverse domain name order. The H file contains the required functions. The compareTo function is provided for you. This will allow you to compare 2 Domain objects.
Also use the StringHelper class provided. The H file of StringHelper outlines all the functions included.
The final list is sorted by as if the list were not reversed.
Below are the given files to complete program.
Domain.cpp
#include <algorithm> // used for min function
#include "Domain.h"
using namespace std;
int Domain::compareTo(Domain that)const {
vector<string> thatFields = that.getFields();
for (int i = 0; i < min(n, that.getN()); i++) {
string s = fields[n - i - 1];
string t = thatFields[that.getN() - i - 1];
int c = s.compare(t);
if(c!= 0)
return c;
}
return 0; //strings are equal
}
Domain.h
#include <vector>
#include <string>
class Domain{
private:
std::vector<std::string> fields;
int n; //length of vector
public:
Domain(std::string);
int getN()const;
std::vector<std::string> getFields()const;
std::string printDomain()const;
int compareTo(Domain)const;
};
DomainDriver.cpp
using namespace std;
//Function prototypes
void swap(int, int, vector<Domain>&);
void sort(vector<Domain>&);
int main(){
return 0;
}
domains.dat
sjc.edu.bz
cs.princeston.edu
auckland.ac.nz
belize.scotiabank.com
ub.edu.bz
ox.ac.uk
cs.auckland.ac.nz
cs.famu.edu
geeksforgeeks.org
my.uscis.gov
dcc.godaddy.com
group.bnpparibas
ocw.mit.edu
mail.google.com
law.unsw.edu.au
sesp.northwestern.edu
drive.google.com
unsw.edu.au
amazon.co.uk
letour.fr
StringHelper.h
#ifndef STRING_HELPER
#define STRING_HELPER
#include <string>
#include <sstream>
#include <vector>
class StringHelper{
public:
static std::vector<std::string> parse(std::string , char );
static std::string toUpper(const std::string );
template<typename T>
static std::string toString(const T& );
};
#endif
In: Computer Science
Calendar Program
Write a program to design an appointment calendar. An appointment includes a description, date, starting time, and ending time. Supply a user interface to add appointments, remove canceled appointments, and print out a list of appointments for a particular day. Appointments should not be duplicated for a given time and date.
Include a class AppointmentMenu to print the menu to the screen and accept user input. AppointmentMenu creates an AppointmentCalendar and then calls the appropriate methods to add, cancel, show, or quit.
Include a class AppointmentCalendar that is not coupled with the Scanner or PrintStream classes. (In other words, all println statements should be in AppointmentMenu.) AppointmentCalendar will include an arrayList of Appointments, a method to add Appointments, a method to cancel Appointments, and return the Appointments for a selected day.
Include a class Appointments which holds the input of description, date, and time. It should have a method to format the output for printing by the AppointmentMenu, a method to check to see if two appointments are equal so an appointment is not duplicated for a given date and time, and a method to check for a certain date when show and cancel are called.
Be sure to include any other methods including any accessor methods that you need to complete this program using the design process described in Chapter 12.
Your main class should be called AppointmentSystem. Use the code below:
/**
A system to manage appointments.
*/
public class AppointmentSystem {
public static void main(String[] args) {
AppointmentMenu menu = new AppointmentMenu();
menu.run();
}
}
Here is a sample program run. (bold items are sample user inputs).
A)dd C)ancel S)how Q)uit A Appointment (Description Date From To) Dentist 01/10/2007 17:30 18:30 A)dd C)ancel S)how Q)uit A Appointment (Description Date From To) Sweets Cafe 01/10/2007 19:00 20:00 A)dd C)ancel S)how Q)uit A Appointment (Description Date From To) CS1 class 02/10/2007 08:30 10:00 A)dd C)ancel S)how Q)uit S Show appointments for which date? 01/10/2007 Appointments: Dentist 01/10/2007 17:30 18:30 Sweets Cafe 01/10/2007 19:00 20:00 A)dd C)ancel S)how Q)uit C Cancel appointments on which date? 01/10/2007 1) Dentist 01/10/2007 17:30 18:30 2) Sweets Cafe 01/10/2007 19:00 20:00 Which would you like to cancel? 1 A)dd C)ancel S)how Q)uit S Show appointments for which date? 01/10/2007 Appointments: Sweets Cafe 01/10/2007 19:00 20:00 A)dd C)ancel S)how Q)uit A Appointment (Description Date From To) Sweets Cafe 01/10/2007 19:00 20:00 This appointment already exists. A)dd C)ancel S)how Q)uit Q
How do I write this program in JAVA not C++ ? Thanks
Also DON'T
import java.io.IOException;
import java.sql.SQLException;
I can only import the scanner class, and ArrayLists and Arrays
What I've done so far is
/**
A system to manage appointments.
*/
public class AppointmentSystem {
public static void main(String[] args) {
AppointmentMenu menu = new AppointmentMenu();
menu.run();
}
}
import java.util.Scanner;
public class AppointmentMenu extends AppointmentCalendar{
public void run(){
Scanner in = new Scanner(System.in);
System.out.println("A)dd C)ancel S)how Q)uit");
String choice = in.nextLine(); {
if (choice.equalsIgnoreCase("A")){
super.addApt();
System.out.println("Appointment(Description Date From To)");
}
if (choice.equalsIgnoreCase("C")){
super.cancelApt();
System.out.println("Cancel appointments on which date?");
}
if (choice.equalsIgnoreCase("S")){
super.showApt();
System.out.println("Show appointments for which date?");
}
if (choice.equalsIgnoreCase("Q"))
return;
}
}
}
import java.util.ArrayList;
public class AppointmentCalendar extends Appointments{
private ArrayList<String[]> appointments = new
ArrayList<String[]>();
public void addApt(){
}
public void cancelApt(){
}
public void showApt(){
}
}
import java.util.ArrayList;
import java.util.Scanner;
public class Appointments {
private ArrayList<String[]> description = new
ArrayList<String[]>();
private ArrayList<String[]> dates = new
ArrayList<String[]>();
private ArrayList<String[]> times = new
ArrayList<String[]>();
}
In: Computer Science
In: Computer Science
Q1) Write a program to implement the quick sort algorithm in a one dimensional array?
Q2) Write a program to implement the merge sort algorithm in a one dimensional array?
In: Computer Science
Data structure
In: Computer Science