Answer:
Here the code is given in java as follows,
What is the default return type of a method in Java language?
A.Void
B.Int
C.None
D.Short
Answer:
The default return data type in function is int
Answer: Option (b)
Explanation:
The default return data type in a function is int. In other words commonly if it is not explicitly mentioned the default return data type of a function by the compiler will be of an integer data type.
If the user does not mention a return data type or parameter type, then C programming language will inevitably make it an int.
mark me brainlist
We have removed
A
balls from a box that contained
N
balls and then put
B
new balls into that box. How many balls does the box contain now?
Constraints
All values in input are integers.
Input
Input is given from Standard Input in the following format: n a b
Output
Print the answer as an integer.
There were [tex]N[/tex] balls but we took [tex]A[/tex] balls out, so there are now [tex]N-A[/tex] balls. We add [tex]B[/tex] balls and now we have [tex]N-A+B[/tex] balls.
The program that computes this (I will use python as language has not been specified is the following):
n, a, b = int(input()), int(input()), int(input())
print(f"There are {n-a+b} balls in the box")
# Hope this helps
Select the correct statement(s) regarding 4B5B encoding.
a. 4B5B is used to map four codeword bits into a five bit data word
b. 4B5B information bit rate is 80% of the total (information plus overhead) bit rate
c. 4B5B information bit rate is 20% of the total (information plus overhead) bit rate
d. all statements are correct
Answer:
b. 4B5B information bit rate is 80% of the total information plus overhead bit rate.
Explanation:
4B5B bit rate encoding means there is 80% of the bit rate which included all the information plus the overheads. There is 20% of lack in bit rate due to encoding code words which converts data into smaller bits.
..............is a piece of hardware used to provide data and instructions to a computer used for interaction and control. *
Output device.
Processing.
input device.
All of above.
Answer:
output
Explanation:
it can be seen and touched
Fred is a 29 year old golfer, who has been playing for 4 years. He is a 12 handicap. He is considering the Srixon ZX5 or the Mavrik Pro. Talk through major considerations and provide a recommendation that would be well suited for him. Include explanations about forged vs cast features, the look of the club, and overall feel.
Answer:
oh nice yes good fine I like it
Indicate whether the following actions are the actions of a person who will be a victim, or will not be a victim, of phishing attacks.
Replying to an e-mail requesting your user ID and password Phishing victim Not a phishing victim
Answer:
Phishing Victim
Explanation:
Replying to this email could make you a victim of a phishing scam. Phishing attacks are common challenges on security that internet users are faced with. It could lead to others getting hold of sensitive information like your password or bank details. email is one way the hackers used to get this information. replying to such an email could lead one to an unsecure website where information could be extracted
Draw a Card. Write a program to simulate drawing a card. Your program will randomly select one card from a deck of 52 playing cards. Your program should display the rank (Ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King) and suit (Clubs, Diamonds, Hearts, Spades) of the card. Here is a sample run of the program: in The card you picked is Jack of Heart The program should use at a minimum: sequence, selection, arrays, and random numbers.
Answer:
Explanation:
The following code is written in Java. It is a function that creates a Random object to generate random values, then uses those values to choose a random rank and suit using switch statements. It then saves the rank and suit into a String variable in the correct format and finally prints the card that was picked to the screen. The function was called 4 times in the main method and the output can be seen in the attached image below.
public static void randomCardGenerator() {
Random rand = new Random();
int rank = rand.nextInt(14)+1;
int suit = rand.nextInt(4)+1;
String chosenCard = "";
switch (rank) {
case 1: chosenCard += "Ace"; break;
case 2: chosenCard += "1"; break;
case 3: chosenCard += "2"; break;
case 4: chosenCard += "3"; break;
case 5: chosenCard += "4"; break;
case 6: chosenCard += "5"; break;
case 7: chosenCard += "6"; break;
case 8: chosenCard += "7"; break;
case 9: chosenCard += "8"; break;
case 10: chosenCard += "9"; break;
case 11: chosenCard += "10"; break;
case 12: chosenCard += "Jack"; break;
case 13: chosenCard += "Queen"; break;
case 14: chosenCard += "Kind"; break;
default: System.out.println("Wrong Value");
}
chosenCard += " of ";
switch (suit) {
case 1: chosenCard += "Clubs"; break;
case 2: chosenCard += "Diamonds"; break;
case 3: chosenCard += "Hearts"; break;
case 4: chosenCard += "Spades"; break;
default: System.out.println("Invalid Suit");
}
System.out.println(chosenCard);
}
Code an operation class called ArrayComputing that will ask user to enter a serials of integers with a loop until -99 is entered and after the input it will keep and display the greatest, the least, the sum and the average of the data entries (-99 is not counted as the data). And code a driver class called ArrayComputingApp to run and test the ArrayComputing class, separately.
Must use required/meaningful names for fields, variables, methods and classes.
Must use separate methods to perform each of specified tasks as described.
Must document each of your source code
Answer:
Explanation:
The following is written in Java and creates the ArrayComputing class. It uses the constructor to create the infinite loop that only breaks when the user enters a -99. After every input number it goes adding the correct values to the variables. Once it is done the user can call any of the getter methods to get the variable values as well as calculate the average.
import java.util.Scanner;
class ArrayComputingApp {
public static void main(String[] args) {
ArrayComputing arrayComputing = new ArrayComputing();
System.out.println("Average: " + arrayComputing.getAverage());
System.out.println("Greatest: " + arrayComputing.getGreatest());
System.out.println("Least: " + arrayComputing.getLeast());
System.out.println("Sum: " + arrayComputing.getSum());
}
}
class ArrayComputing {
int greatest, least, sum, average;
int count = 0;
Scanner in = new Scanner(System.in);
public ArrayComputing() {
while (true) {
System.out.println("Enter a number or -99 to exit: ");
int num = in.nextInt();
if (num == -99) {
break;
}
if (num > this.greatest) {
this.greatest = num;
}
if (this.count == 0) {
this.least = num;
} else {
if (num < this.least) {
this.least = num;
}
}
this.sum += num;
this.count += 1;
}
}
public int getAverage() {
this.average = sum / count;
return this.average;
}
public int getGreatest() {
return greatest;
}
public int getLeast() {
return least;
}
public int getSum() {
return sum;
}
}
1. Write the CSS for an id with the following characteristics: fixed position, light grey background color, bold font weight, and 10 pixels of padding
Answer:
#element
{
position: fixed;
background-color: RGBA(211, 211, 211, 1);
font-weight: bold;
padding: 10px;
}
Assume that an O(log2N) algorithm runs for 10 milliseconds when the input size (N) is 32. What input size makes the algorithm run for 14 milliseconds
Answer:
An input size of N = 128 makes the algorithm run for 14 milliseconds
Explanation:
O(log2N)
This means that the running time for an algorithm of length N is given by:
[tex]F(N) = c\log_{2}{N}[/tex]
In which C is a constant.
Runs for 10 milliseconds when the input size (N) is 32.
This means that [tex]F(32) = 10[/tex]
So
[tex]F(N) = c\log_{2}{N}[/tex]
[tex]10 = c\log_{2}{32}[/tex]
Since [tex]2^5 = 32, \log_{2}{32} = 5[/tex]
Then
[tex]5c = 10[/tex]
[tex]c = \frac{10}{5}[/tex]
[tex]c = 2[/tex]
Thus:
[tex]F(N) = 2\log_{2}{N}[/tex]
What input size makes the algorithm run for 14 milliseconds
N for which [tex]F(N) = 14[/tex]. So
[tex]F(N) = 2\log_{2}{N}[/tex]
[tex]14 = 2\log_{2}{N}[/tex]
[tex]\log_{2}{N} = 7[/tex]
[tex]2^{\log_{2}{N}} = 2^7[/tex]
[tex]N = 128[/tex]
An input size of N = 128 makes the algorithm run for 14 milliseconds
You are having a problem with your Windows computer that is isolated to a single graphics editing program that you use every day in your work. When you described the problem to the customer service support person for this product, she told you that the only fix for it is to edit a key under HKEY-LOCAL_MACHINE\SOFTWARE. She has assured you that this fix will work without causing any problems, but you are wary of doing this. Descript the steps and precautions taken.
Answer:
I'm not a big tech head but I know that creating a restore point is highly recommended for changing anything that you aren't 100% sure about to your computer.
State two ways of preventing virus attack on a computer.
Answer:
updating the computer and having an anti virus on your computer
From which panel can you insert Header and Footer in MS Word?
Answer:
Insert tap is the answer
the answer is ..
insert tab
What is machine learning
Answer:
machine learning is the ability for computers to develop new skills and algorithms without specific instructions to do so.
Print the two strings in alphabetical order. Assume the strings are lowercase. End with newline. Sample output: capes rabbits import java.util.Scanner: public class OrderStrings { public static void main (String args) { String firstString: String secondString: firstString = "rabbits" secondString = "capes" /*Your solution goes here */ return: } }import java.util.Scanner;public class OrderStrings { public static void main(String[] args) { String firstString; String secondString; firstString = "rabbit"; secondString= "capes"; //String class in java provide string comparison function, use it, and get //your work done may even use brute force i.e using for loop and compare character by // character which will not good for the programming language which already have vast //predefined number of functions if(firstString.compareTo(secondString) < 0){ System.out.println(firstString + " " + secondString); } else{ System.out.println(secondString + " " + firstString); } return; }}
Answer:
Following are the code to the given question:
import java.util.Scanner;//import package
public class OrderStrings // defining a class OrderStrings
{
public static void main(String[] args) //defining a main method
{
Scanner scnr = new Scanner(System.in);//defining a Scanner class object
String firstString;//defining a String variable
String secondString; //defining a String variable
firstString = scnr.next();//input value
secondString = scnr.next();//input value
if (firstString.compareTo(secondString) < 0)//use if to compare sting value
System.out.println(firstString + " " + secondString);//print sting value
else//else block
System.out.println(secondString + " " + firstString);//print sting value
}
}
Output:
rabbits capes
capes rabbits
Explanation:
In this code a class "OrderStrings" is defined inside the class the main method is defined that declares the two string variable that uses the input method to input the string value and after input, it uses the conditional statement. Inside this compareTo method is declared that compare string value and prints the string value.
what is the characteristics of computer?dicuss any 5 of them
Answer:
speed
accuracy
diligence
versatility
reliabiility
memory
speed: a computer works with more higher speed compared to humans when performing mathematical calculations
accuracy: computer perform calculations with 100% accuracy
dilligence:a computer can perform calculations with the same consistentcy and accuracy
versatility:refers to the capability of a computer to perform different kind of works with same accuracy and efficiencies
reliability
Answer:
speed
accuracy
diligent
versatile
storage and communication
Create a variable in php to store your university information and parse using jQuery Ajax and print your name. The variable must contain information about name, roll no, department and CGPA.
AnswLab giya j ty dy dio:
Explanation:
how much is this worth in dollars
Answer:
This is worth 50 dollars.
Explanation:
١ - one
٢ - two
٣ - three
٤ - four
٥ - five
٦ - six
٧ - seven
٨ - eight
٩ - nine
٠ - zero
What you see above is the ten digits in Arabic.
Both 5 (٥) and 0 (٠) appear here, thus representing 50.
9.18 LAB: Exact change - methods Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per line. The coin types are dollars, quarters, dimes, nickels, and pennies. Use singular and plural coin names as appropriate, like 1 penny vs. 2 pennies. Ex: If the input is:
Answer:
Explanation:
The following code is written in Java. It asks the user to enter the amount of change needed. This is done as a double since we are dealing with coins and not full dollar values alone. It then makes the necessary calculations to calculate the number of each coin needed and outputs it back to the user. A test case has been provided in the picture below with a sample output.
import java.util.Scanner;
class Brainly {
public static void main(String[] args) {
int dollars = 1;
double quarters = 0.25;
double dimes = 0.10;
double nickels = 0.05;
double pennies = 0.01;
Scanner in = new Scanner(System.in);
System.out.println("Enter Change Value: ");
double change = in.nextDouble();
int numDollars, numQuarters, numDimes, numNickels, numPennies;
double newChange;
numDollars = (int) (change / dollars);
newChange = change % dollars;
numQuarters = (int) (newChange / quarters);
newChange = newChange % quarters;
numDimes = (int) (newChange / dimes);
newChange = newChange % dimes;
numNickels = (int) (newChange / nickels);
newChange = newChange % nickels + 0.001;
numPennies = (int) (newChange / pennies);
newChange = newChange % pennies;
System.out.println("Minimum Num of Coins needed: ");
if (numDollars != 1) {
System.out.println(numDollars + " Dollars");
} else {
System.out.println(numDollars + " Dollar");
}
if (numQuarters != 1) {
System.out.println(numQuarters + " Quarters");
} else {
System.out.println(numQuarters + " Quarter");
}
if (numDimes != 1) {
System.out.println(numDimes + " Dimes");
} else {
System.out.println(numDimes + " Dime");
}
if (numNickels != 1) {
System.out.println(numNickels + " Nickels");
} else {
System.out.println(numNickels + " Nickel");
}
if (numPennies != 1) {
System.out.println(numPennies + " Pennies");
} else {
System.out.println(numPennies + " Penny");
}
}
}
The program is an illustration of conditional statements
Conditional statements are used to make decisions
The program in C++ where comments are used to explain each line is as follows
#include<iostream>
using namespace std;
int main() {
// This line declare all the variables
int amount, dollar, quarter, dime, nickel, penny;
// This prompts the user for input (i.e. the amount)
cout<<"Amount: ";
//This gets the amount from the user
cin>>amount;
// This checks if the amount is 0 or less
if(amount<=0) {
//This prints "No Change"
cout<<"No Change";
}
//If the amount is greater than 0
else {
// These convert the amount to various coins
dollar = amount/100;
amount = amount%100;
quarter = amount/25;
amount = amount%25;
dime = amount/10;
amount = amount%10;
nickel = amount/5;
penny = amount%5;
// The next lines print the coins
if(dollar>=1) {
if(dollar == 1) {
cout<<dollar<<" dollar\n"; }
else {
cout<<dollar<<" dollars\n"; }
}
if(quarter>=1) {
if(quarter== 1) {
cout<<quarter<<" quarter\n";
}
else {
cout<<quarter<<" quarters\n";
}
}
if(dime>=1) {
if(dime == 1) {
cout<<dime<<" dime\n";
}
else {
cout<<dime<<" dimes\n";
}
}
if(nickel>=1) {
if(nickel == 1) {
cout<<nickel<<" nickel\n";
}
else {
cout<<nickel<<" nickels\n";
}
}
if(penny>=1) {
if(penny == 1) {
cout<<penny<<" penny\n";
}
else {
cout<<penny<<" pennies\n";
}
}
}
return 0;
}
Read more about conditions at:
https://brainly.com/question/15683939
You've arrived on site to a WAN installation where you will be performing maintenance operations. You have been told the WAN protocol in use allows multiple Layer 3 protocols and uses routers that use labels in the frame headers to make routing decisions. What WAN technology is in use
Answer:
The answer is "MPLS".
Explanation:
The MPLS stands for Multiprotocol Label Switching. This packet switching method facilitates the generation of easier personal backbones using a less physical channel, which sends information from one source to its destination with labels rather than IP addresses. Many of these WAN services are sold through huge companies. It is also a technology for data transfer that boosts speed and regulates network traffic flow. The information is directed with this technology via a label rather than needing complicated surveys at every stop in a route cache.
Which operating system desktop or mobile is the best
Answer:
bing or alien ware is the best.
Answer:
Your choice, but personally, desktop is better.
Explanation:
Desktop devices have portrait orientations so content can stretch across a screen and often multiple messages or images can live comfortably in such a wide space. Mobile devices are usually used in portrait orientation (and the smaller screens mean that even in landscape mode, horizontal space is limited).
Explain the following terms.
a) Explain Final keyword with example. b) Define Static and Instance variables
Answer:
A.
the final keyword is used to denote constants. It can be used with variables, methods, and classes. Once any entity (variable, method or class) is declared final , it can be assigned only once.
B.
Static variables are declared in the same place as instance variables, but with the keyword 'static' before the data type. While instance variables hold values that are associated with an individual object, static variables' values are associated with the class as a whole.
Definition of digital
Answer:
There are two definitions from
Explanation:
1.) (of signals or data) expressed as series of the digits 0 and 1, typically represented by values of a physical quantity such as voltage or magnetic polarization.
2.) (of a clock or watch) showing the time by means of displayed digits rather than hands or a pointer.
I'm not sure if you meant "Digit". But if you did it would mean numbers or the places where numbers would go.
Hope this helps! (If not so sorry)
Answer:
adjective
1.
(of signals or data) expressed as series of the digits 0 and 1, typically represented by values of a physical quantity such as voltage or magnetic polarization.
relating to, using, or storing data or information in the form of digital signals.
"digital TV"
involving or relating to the use of computer technology.
"the digital revolution"
9. Which of the following prefixes which relate to bytes are arranged from the smallest to the largest? a) mega, giga, tera, kilo b) meqa tera, giga, kilo c) kilo, mega, giga, tera d) kilo, giga, mega, tera
Answer:
Explanation:
C
kilo = 1000
mega = 1,000,000
giga = 1 billion = 1 000 000 000
tera = 1 trillion = 1 000 000 000 000
Your network has four Hyper-V hosts, which are running three domain controllers and about 10 member servers. Three of the member servers named HR1, HR2, and HR3 are running on a Windows Server 2012 R2 Hyper-V host; the others are running on Windows Server 2016 Hyper-V hosts. All VMs are running Windows Server 2016. You are currently running an enterprise human resources application on the HR1, HR2, and HR3 servers. You are considering upgrading this application to a new version that was recently released. Before you proceed with the upgrade, you set up a test environment consisting of a Windows Server 2016 Hyper-V host and three VMs. You haven't been using checkpoints on any of your VMs, but you want to start doing so as an extra form of disaster recovery in the event of VM corruption or errors introduced by updates. On your test environment, you want to use checkpoints while you are testing the new application. What type of checkpoints should you use throughout your live network and test network? Explain.
Answer:
Explanation:
Write a program that uses a stack to test input strings to determine whether they are palindromes. A palindrome is a sequence of characters that reads the same as the sequence in reverse; for example, noon.
Answer:
Here the code is given as follows,
Explanation:
def isPalindrome(x):
stack = []
#for strings with even length
if len(x)%2==0:
for i in range(0,len(x)):
if i<int(len(x)/2):
stack.append(x[i])
elif stack.pop()!=x[i]:
return False
if len(stack)>0:
return false
return True
#for strings with odd length
else:
for i in range(0,len(x)):
if i==int(len(x)/2):
continue
elif i<int(len(x)/2):
stack.append(x[i])
elif stack.pop()!=x[i]:
return False
if len(stack)>0:
return false
return True
def main():
while True:
string = input("Enter a string or Return to quit: ")
if string == "":
break
elif isPalindrome(string):
print("It's a palindrome")
else:
print("It's not a palindrome")
if __name__ == '__main__':
main()
Transformative Software develops apps that help disabled people to complete everyday tasks. Its software projects are divided into phases in which progress takes place in one direction. The planning, delivery dates, and implementation of the software under development are emphasized. Which software development methodology is the company most likely using:_________.
Answer: Cascading
Explanation:
The software development methodology that the company is most likely using is Cascading.
Cascading model is a sequential design process, that is used in software development, whereby progress flows downward from the conception phase, initiation phase, till it gets to the maintenance phase.
When implementing a 1:1 relationship, where should you place the foreign key if one side is mandatory and one side is optional? Should the foreign key be mandatory or optional?
Answer:
When implementing a 1:1 relationship, the foreign key should be placed on the optional side if one side is mandatory and one side is optional.
When this is implemented, the foreign key should be made mandatory.
Explanation:
A foreign key (FK) is a primary key (PK) in relational databases. It is used to establish a relationship with a table that has the same attribute with another table in the database. A mandatory relationship exists when the foreign key depends on the parent (primary key) and cannot exist without the parent. A one-to-one relationship exists when one row in a data table may be linked with only one row in another data table.
Given main(), complete the Car class (in file Car.java) with methods to set and get the purchase price of a car (setPurchasePrice(), getPurchasePrice()), and to output the car's information (printInfo()).
Ex: If the input is:
2011
18000
2018
where 2011 is the car's model year, 18000 is the purchase price, and 2018 is the current year, the output is:
Car's information:
Model year: 2011
Purchase price: 18000
Current value: 5770
Note: printInfo() should use three spaces for indentation.
Answer and Explanation:
public class Main {
int Carmodel;
int Purchaseprice;
int Currentyear;
Public void setPurchasePrice(int Purchaseprice){
this.Purchaseprice=Purchaseprice;
}
Public void getPurchasePrice(){
return Purchaseprice;
}
static void printInfo(int Carmodel int Currentyear ){
this.Carmodel=Carmodel;
this.Currentyear=Currentyear;
System.out.println(getPurchasePrice() Carmodel Currentyear);
}
}
The above java program defines a class that has three methods, a get method that returns purchase price of the object, a set method that sets purchase price of the object, and a print method that print out the information about the car object(model, year, price). The print method also takes arguments and assigns values of the arguments/parameters to the object, then prints all.
Write a recursive function that calculates the sum 11 22 33 ... nn, given an integer value of nin between 1 and 9. You can write a separate power function in this process and call that power function as needed:
Answer:
The function in Python is as follows:
def sumDig(n):
if n == 1:
return 11
else:
return n*11 + sumDig(n - 1)
Explanation:
This defines the function
def sumDig(n):
This represents the base case (where n = 1)
if n == 1:
The function returns 11, when it gets to the base case
return 11
For every other value of n (n > 1)
else:
This calculates the required sum recursively
return n*11 + sumDig(n - 1)