Use Booth’s algorithm to multiply -5 and 7.
In: Computer Science
Create a class named Ship with a field that stores a collection of Shippable things and another that stores a maximum weight capacity. Include a constructor with a parameter for the max weight, and that gives the Ship an empty collection of Shippables. (Javascript)
In: Computer Science
Given a number represented exponentially, calculate it's
value.
The number might be very large so print out its value mod 91.
Input Format
First line is the number (n) of exponentials you will have to
calculate.
The next n lines will each contain two values (b and e), the base
value and the exponent.
Constraints
All input values will be valid java integers. n will be >
0
b will be > 0 and <= 10000
e will be >= 0
Output Format
Output n values, the solutions for each of the n exponents you are given.
Sample Input 0
3
13 3
76 3
100 3
Sample Output 0
13
83
1
Explanation 0
13^3 = 13 * 13 * 13 = 2197
2197 mod 91 = 13
76^3 = 76 * 76 * 76 = 483,976
483,976 mod 91 = 83
100^3 = 100 * 100 * 100 = 1,000,000
1,000,000 mod 91 = 1
Sample Input 1
6
90 3
66 3
90 3
80 4
28 4
90 4
Sample Output 1
90
27
90
81
42
1
In: Computer Science
write this program in java... don't forget to put comments.
You are writing code for a calendar app, and need to determine the end time of a meeting. Write a method that takes a String for a time in H:MM or HH:MM format (the program must accept times that look like 9:21, 10:52, and 09:35) and prints the time 25 minutes later.
For example, if the user enters 9:21 the method should
output
9:46
and if the user enters 10:52 the method should output
11:17
and if the user enters 12:45 the method should output
1:10
In: Computer Science
HASKELL PROGRAMMING
Use the functions concatenate AND concatList to write the functions below:
1) WRITE the function: concatStringsUsingDelimiter (can use fold instruction and a lambda expression to define)
Sample run = *Main> concatStringsUsingDelimiter '#' ["The", "quick" , "boy" , "ran."]
"The#quick#boy#ran.#"
2) WRITE the function: unconcatStringWithDelimiter (inverse of function above. can use haskell's let construct and/or where construct)
Sample run = *Main> unconcatStringWithDelimiter '#'
"The#quick#boy#ran.#"
["The" , "quick" , "boy" , "ran."]
SIDE NOTE: Please write comments describing each function and a type definition for each function preceding the function definition
In: Computer Science
a. Why is GPU important in a computer? Explain in your own words.
b. If you are visiting the your college campus with the help of a head mounted display (HMD) that feels like you are at your campus physically where you are attending classes and roaming around with your friends.
i) What kind of technology can help getting you this kind of experience?
ii) Justify your answer with the technological aspects whether it used virtual or augmented reality?
iii) Compare, how virtual and augmented reality techniques differ from each other?
c. List down some remarkable AR applications that you might admire.
In: Computer Science
Language: Java or C (NO OTHER LANGUAGE)
Do NOT use Java library implementations of the data structures (queues, lists, STs, hashtables etc.)
Have a unit test implemented in main(). And comment every code.
Show examples from the executions.
Assume that the edges defined by the vertex pairs in the data base are one-way.
Question: Write a program that can answer if there is a path
between any to vertices.
For the vertex pairs use this as your input example:
AL FL
AL GA
AL MS
AL TN
AR LA
AR MO
AR MS
AR OK
AR TN
AR TX
AZ CA
To the comment: what do you mean with year? There is no year
In: Computer Science
In: Computer Science
You have just finished installing a network adapter and booted
up the system, installing the drivers. You open File Explorer on a
remote computer and don’t see the computer on which you installed
the new NIC. What is the first thing you check? The second
thing?
Has IPv6 addressing been enabled?
Is the computer using dynamic or static IP addressing?
Do the lights on the adapter indicate it’s functioning correctly?
Has the computer been assigned a computer name?
You have just installed a SOHO router in a customer’s home and
the owner has called to say his son is complaining that Internet
gaming is too slow. His son is using a wireless laptop. Which
possibilities should you consider to speed up the son’s gaming
experience? Select all that apply.
Verify that the wireless connection is using the fastest wireless standard the router supports.
Disable encryption on the wireless network to speed up transmissions.
Suggest the son use a wired Gigabit Ethernet connection to the network.
Enable QoS for the gaming applications on the router and on the
son’s computer.
You need a VPN to connect to a private, remote network in order
to access some files. You click the network icon in your taskbar to
establish the connection, and realize there is no VPN option
available on the menu. What tool do you need to use to fix this
problem?
net command
netstat command
Network and Sharing Center
Network Connections window
You’re troubleshooting a network connection for a client at her home office. After pinging the network’s default gateway, you discovered that the cable connecting the desktop to the router had been damaged by foot traffic and was no longer providing a reliable signal. You replaced the cable, this time running the cable along the wall so it won’t be stepped on. What do you do next?
In: Computer Science
java code
Question 2: What are the type and value of each of the expressions below?
int [] numbers = { 3, 6, 15, 22, 100, 0 };
double [] decimals = { 3.5, 4.5, 2.0, 2.0, 2.0 };
String [] words = {"alpha", "beta", "gamma"};
numbers[3] + numbers[2]
decimals[2] - decimals[0] + numbers[4]
words[1].charAt( numbers [0] )
numbers[4] * decimals[1] <= numbers[5] * numbers[0]
In: Computer Science
Write a c++ program that does the following,
read temperatures from a file name temp.txt into an array, and
after reading all the temperatures, output the following information: the average temperature, the minimum temperature, and the total number of temperatures read.
Thank you!
In: Computer Science
java code
Question 4:
Iterating with loops
You can process the list using a For loop. The variable in the For loop becomes the index value for each of the items in the loop. Everything you do to an element inside the loop gets done for the entire list. Examine the following loops. Then use what you know to write the following loops.
int[] numbers = new int[100];
for(int i = 0; i < numbers.length; i++){
numbers[i] = i;
}
int sum = 0;
for(int i = 0; i < numbers.length; i++){
sum += numbers[i];
}
Write a loop to display all the numbers in the list.
Write a loop to display the number in the list in reverse order.
Write a loop with an if statement to print only the even numbers in the list.
Write a loop to subtract the value 50 to every element in the list.
Write a loop to count the number of negative values in the list.
In: Computer Science
I'm getting an error message with this code and I don't know how to fix it
The ones highlighted give me error message both having to deal Scanner input string being converted to an int. I tried changing the input variable to inputText because the user will input a number and not a character or any words. So what can I do to deal with this
import java.util.Scanner;
public class Project4 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// Find Prime Numbers using sequential divisors.
String inputText;
int numberOfPrimes;
Scanner input = new Scanner(System.in);
System.out.printf("How many primes to calculate? ");
inputText = input.nextLine();
numberOfPrimes = Integer.parseInt(inputText);
int[] primes = new int[input];
int primeCount = 0;
int divisorsCount = 0;
int number = 2;
double sqrt;
boolean isPrime;
while(primeCount < input) {
isPrime = false;
sqrt = Math.sqrt(number);
for(int i = 0; i < primeCount; i++) {
if(primes[i] <= sqrt) {
divisorsCount++;
if(number % primes[i] == 0) {
isPrime = false;
}
}
}
}
if(isPrime) {
primes[primeCount] = number;
primeCount++;
divisorsCount=0;
System.out.println("prime = " + primeCount + "count = " +
number
+ ", " + "divisorsCount = " + divisorsCount);
}
}
In: Computer Science
1. When a method definition contains an invocation of itself, the method is said to be _________.
2. When a method definition contains an invocation of itself, the method is said to be _________.
3. True or False. A recursive method needs to have an if-else or other branching leading to different cases.
4. True or False. A recursive method should only contain one call to itself.
In: Computer Science
Java Program
Please Read all directions carefully
Write a method named smallToLarge that asks the user to enter numbers, then prints the smallest and largest of all the numbers typed in by the user and the average (rounded to 2 decimal places). You may assume the user enters a valid integer number for the number of numbers to read. Here is an example dialogue:
/* initialize smallest and largest variables with the 1st user input for Number */
How many numbers do you want to enter? 3 Number 1: 7 Number 2: 11 Number 3: -2 Smallest = -2 Largest = 11 Average = 5.33
In: Computer Science