The function is an illustration of loops
Loops are used to perform repetitive operations
The function in Java where comments are used to explain each line is as follows:
//This defines the remove_duplicates function
public static int remove_duplicates(int arr[], int n){
//If the length of the array is 0 or 1, then return the original array
if (n == 0 || n == 1) {
return n;
}
//This creates a new array
int[] newArr = new int[n];
//This initializes the index of the array to 0
int ind = 0;
//This iterates through the original array
for (int i = 0; i < n - 1; i++) {
//The following loop populates the new array with the unique elements of the original array
if (arr[i] != arr[i + 1]) {
newArr[ind++] = arr[i];
}
}
newArr[ind++] = arr[n - 1];
// The following loop changes the original array
for (int i = 0; i < ind; i++) {
arr[i] = newArr[i];
}
return ind;
}
At the end of the function, the duplicate elements of the array are removed
Read more about similar programs at:
https://brainly.com/question/22552591
Develop an algorithm and draw a flowchart to determine and input number is palindrome or not.
Today we see the advantages as well as disadvantages of a wired network. In comparison what technology would you recommend Wired Ethernet or a Wireless network technology for home and what would you recommend for business? Explain your answer
Answer:
wired network
Explanation:
Wired networks are generally much faster than wireless networks. ... This is mainly because a separate cable is used to connect each device to the network with each cable transmitting data at the same speed. A wired network is also faster since it never is weighed down by unexpected or unnecessary traffic.
hope that helps your welcome
WORTH 75 POINTS!!
Which best describes the video encoding process?
converting analog video into digital video
filming a video at 30 frames per second
saving a digital video in a specific file format
watching a video while the file downloads
Answer:
To watch a digital video, you must use the codec that was used to encode the video file. Most videos are compressed.
Answer:
Why is compression important for video streaming?
to increase the number of frames per second so that motion appears smooth
to watch video without waiting for it to download(this one)
to improve image quality
to increase file size
Explanation:
Write an inheritance hierarchy for classes Quadrilateral, Trapezoid, Parallelogram, Rectangle and Square. Use Quadrilateral as the superclass of the hierarchy. Create and use a Point class to represent the points in each shape. Make the hierarchy as deep (i.e., as many levels) as possible. Specify the instance variables and methods for each class. The private instance variables of Quadrilateral should be the x-y coordinate pairs for the four endpoints of the Quadrilateral. Write a program that instantiates objects of your classes and outputs each object‟s area (except Quadrilateral
Answer:
CODE:
public class QuadrilateralTest {
public static void main(String[] args) {
// NOTE: All coordinates are assumed to form the proper shapes
// A quadrilateral is a four-sided polygon
Quadrilateral quadrilateral =
new Quadrilateral(1.1, 1.2, 6.6, 2.8, 6.2, 9.9, 2.2, 7.4);
// A parallelogram is a quadrilateral with opposite sides parallel
Parallelogram parallelogram =
new Parallelogram(5.0, 5.0, 11.0, 5.0, 12.0, 20.0, 6.0, 20.0);
// A rectangle is an equiangular parallelogram
Rectangle rectangle =
new Rectangle(17.0, 14.0, 30.0, 14.0, 30.0, 28.0, 17.0, 28.0);
// A square is an equiangular and equilateral parallelogram
Square square =
new Square(4.0, 0.0, 8.0, 0.0, 8.0, 4.0, 4.0, 4.0);
System.out.printf(
"%s %s %s %s\n", quadrilateral, parallelogram,
rectangle, square);
}
}
RESULT:
Coordinates of Quadrilateral are:
2 (1.1, 1.2), (6.6, 2.8), (6.2, 9.9), (2.2, 7.4)
3
4 Coordinates of Parallelogram are:
5 (5.0, 5.0), (11.0, 5.0), (12.0, 20.0), (6.0, 20.0)
6 Width is: 6.0
7 Height is: 15.0
8 Area is: 90.0
9
10 Coordinates of Rectangle are:
11 (17.0, 14.0), (30.0, 14.0), (30.0, 28.0), (17.0, 28.0)
12 Width is: 13.0
13 Height is: 14.0
14 Area is: 182.0
15
16 Coordinates of Square are:
17 (4.0, 0.0), (8.0, 0.0), (8.0, 4.0), (4.0, 4.0)
18 Side is: 4.0
19 Area is: 16.0
Explanation:
In this exercise we have to use the knowledge of computational language in JAVA, so we have that code is:
It can be found in the attached image.
So, to make it easier, the code in JAVA can be found below:
public class QuadrilateralTest {
public static void main(String[] args) {
new Quadrilateral(1.1, 1.2, 6.6, 2.8, 6.2, 9.9, 2.2, 7.4);
new Parallelogram(5.0, 5.0, 11.0, 5.0, 12.0, 20.0, 6.0, 20.0);
new Rectangle(17.0, 14.0, 30.0, 14.0, 30.0, 28.0, 17.0, 28.0);
new Square(4.0, 0.0, 8.0, 0.0, 8.0, 4.0, 4.0, 4.0);
System.out.printf(
"%s %s %s %s\n", quadrilateral, parallelogram,rectangle, square);
}
}
See more about JAVA at brainly.com/question/2266606
Which of the following is a federal initiative that is designed to encourage organizations to address how critical operations will continue under a broad range of negative circumstances?
A continuity of operation planning (COOP) is an initiative that is designed by the federal government, so as to encourage business organizations and its departments to address how essential functions and critical operations will continue under a broad range of negative circumstances (disaster).
Business continuity can be defined as an advanced planning, processes, procedures, preparation, and decisions made by a business organization, so as to ensure the maintenance of essential functions and critical operations during and after the occurrence of a disaster. Thus, a disaster recovery plan (DRP), business impact analysis (BIA) and continuity of operation planning (COOP) are an integral and important part of business continuity.
A continuity of operation planning (COOP) is an initiative that is designed by the federal government of the United States of America, so as to encourage business organizations and its departments to address how essential functions and critical operations will continue under a broad range of negative circumstances (disaster).
In continuity of operation planning (COOP), an all round hazard approach is adopted rather than just focusing on specific hazardous events, in order to ensure essential functions and critical operations of a business organizations will continue under a broad range of negative circumstances (disaster).
Read more: https://brainly.com/question/17586013
In the EXPLORE online library, the ratio of the number of novels to that of dictionaries is 2:3 and the total number of novels is 624. If Joe buys more novels and the ratio becomes 7:3, then how many novels have been bought in total?
Answer:
Answer is 2184
Explanation:
1st of all we need to know the total number of novels in the library if I have it with a ratio of one meaning:
2---------624
1----------???
(1×624)÷2 =312
Meaning with a ratio of 1 I'll have 312
Take the 312 and multiply with 7
It will give you 2184
That's the number of Novels which were bought by joe
what is the difference between information poor and information rich
Answer:
The “Information poor” are consumers who use traditional mass media information such as television, DVDs, radios and magazines. ... On the opposite “information rich” stands for a new elite within the information society.
Explanation:
1. Fill in the blanks with appropriate word. 5°1-5 is a collection of raw unprocessed facts, figures, and symbols
Answer:
e
Explanation:
e
True or False. When FTP users authenticate with an FTP server, the sign-in process can be decoded by a protocol analyzer or network sniffer software.
The File Transfer Protocol is commonly called FTP. FTP users authenticate with an FTP server, the sign-in process can be decoded by a protocol analyzer or network sniffer software is a true statement.
There are some element that often specifies the authentication settings for FTP sites. The authentication settings are known to be wired or configured at only the site-level. They can also be configured per URL.The File Transfer Protocol (FTP) is known simply as a standard communication protocol that is often employed for the movement of computer files from a server to a client using a computer network.
It uses the client–server model architecture via different control and data connections between the client and the server.
Learn more from
https://brainly.com/question/20602197
In a _____, there is no skipping or repeating instructions. A. iteration B. sequence C. selection D. conditional
Answer:
B: Sequence.
Explanation:
Write javascript code for the form that appears in the image below. you are expected to add validation to the name field, email field, and radio button selection. The HTML code is given below, Insert the javascript validation code in the area of the HTML code shown below and save the file. Paste one screenshot of the validation you have written.
Couldn't find much on this, and don't rly know what to do.
what is the different sheets in excel
Answer:
By clicking the sheet tabs at the bottom of the Excel window, you can quickly select one or more sheets. To enter or edit data on several worksheets at the same time, you can group worksheets by selecting multiple sheets. You can also format or print a selection of sheets at the same time.
Explanation:
hope this helps
stages of IT revolution
Answer:
Technological revolutions are dissected into three stages:
The introduction stageThe permeation stageThe power stage
explain how you activate window explore
Answer:
Win+R -> Type "explorer.exe" -> Press enter
Sarah was recently reviewing all the photos that she has saved on her computer and was shocked to find that she has over 10,000 images. Thankfully, digital photography will allow her to rearrange, organize, and easily search within her photos. What types of tasks are these?
A.
image evolution
B.
image formatting
C.
image editing
D.
image management
Answer:
D
Explanation:
image management
The type of task that allows Sarah to rearrange, organize, and easily search within her photos is known as Image management. Thus, the correct option for this question is D.
What do you mean by image management?Image management may be characterized as a type of feature that allows a user to store, organize, centralize, and distribute digital images, assets, and graphics that are automatically saved in the computer. It also evaluates and enhances your image with respect to the perception of others.
According to the context of this question, image formatting nay deals with the file formatting for a digital image such as JPEG, PNG, GIF, etc. Image editing encompasses the process and strategy of acquiring alteration in the image with respect to a user.
Therefore, image management is the task that allows Sarah to rearrange, organize, and easily search within her photos. Thus, the correct option for this question is D.
To learn more about Image management, refer to the link:
https://brainly.com/question/19263329
#SPJ2
Write a python function to compute a certain number to a given power. The program should continue asking the user for number and power and display the result until the user enters 0 as the number. Note: don't use the power function of Python. Compute the power using a for or a while loop.
while True:
number = int(input("input the number: "))
exponent = int(input("input the exponent : "))
if number == 0:
break
else:
result = 1
while exponent != 0:
result *= number
exponent-=1
print("Answer = " + str(result))
we are asked not to use the power function of python. The question wants us to use a for or a while loop to compute the power.
The while loop makes sure the user is always asked to input the number and an exponent.
If the users number equals 0, the while loop will break.
Else the code will find the power of the number.
Finally, we print the answer if the user number is not zero
The bolded part of the code are python keywords.
read more: https://brainly.com/question/12992668?referrer=searchResults
Create a program that uses an array of Shape references to objects of each concrete class in the hierarchy (see program-2). The program should print a text description of the object to which each array element refers. Also, in the loop that processes all the shapes in the array, determine the size of each shape If it‟s a TwoDimensionalShape, display its area. If it‟s a ThreeDimensionalShape, display its area and volum
The program uses an array for shape reference to objects of each concrete class given. The program is in text description in java language.
What is a program array?Array programming in computer science refers to methods that allow operations to be applied to a whole set of values at once. This kind of solution is frequently used in scientific and engineering settings.
Shape.java
public abstract class Shape { private int sides;
public Shape() {
this.sides=0;
}
public Shape(int sides) { super(); this.sides = sides;
}
public int getSides() { return sides;
}
public void setSides (int sides) { this.sides = sides;
}
public abstract double calcArea();
Override
public String toString() {
return "This Shape has [sides=" + sides + "]";
Therefore, the program array is given above.
To learn more about program array, refer to the link:
https://brainly.com/question/13104121
#SPJ2
You are a knowledge engineer and have been assigned the task of developing a knowledge base for an expert system to advise on mortgage loan applications. What are some sample questions you would ask the loan manager at a bank?
As a knowledge engineer, it should be noted that some of the questions that should be asked include:
What do you expect in the loan application process?How is the loan going to be processed?What do you expect from the applicant to fund the loan?A knowledge engineer simply means an engineer that's engaged in the science of building advanced logic into the computer systems.
Since the knowledge engineer has been assigned the task of developing a knowledge base for an expert system to advise on mortgage loan applications, he should asks questions that will be vital for the loan process.
Learn more about engineers on:
https://brainly.com/question/4231170
The web design teams of a company are working on designing websites for various companies, Pick the ideas that employ proper use of
metaphor.
Danny is creating a website for senior citizens that uses large fonts to improve accessibility. Keenan is working on a website for school children
learning chemistry that is designed to look like a chemistry lab. Justin has created a website for a flower bouquet manufacturer that shows all
the available types of bouquets. Adam has designed a website for viewing movie trailers for the local cinema that display the video on a screen
made to look like a drive-in theater. Paul has created a website for pre-school children to learn English using very simple language and small
words.
Answer:
C
Explanation:
I KNOW ITS RIHGHT
Answer:
1. Keenan is working on a website for school children learning chemistry that is designed to look like a chemistry lab. 2. Adam has designed a website for viewing movie trailers for the local cinema that display the video on a screen made to look like a drive-in theater
Explanation: 5/5 on the test
3. Elaborate why and how you use “Output” command in Python Programming Language, write the syntax of output command?
Answer:
Explanation:
you use print() to output something
so it would be like this:
print("What is up, gamer?")
so the syntax is print() with whatever is in the parentheses being what you want to output
We can find out how robots work by looking in detail at the smaller parts. What do we call this?
Answer: This can be called the engineering.
Explanation:
Because the small parts is the bearings inside the robot
You modified the GreenvilleRevenue program to include a number of methods. Now modify every data entry statement to use a TryParse() method to ensure that each piece of data is the correct type. Any invalid user entries should generate an appropriate message, and the user should be required to reenter the data.
using System;
using static System.Console;
class GreenvilleRevenue
{
static void Main(string[] args)
{
const int fee = 25;
int lastYearsContestants;
int thisYearsContestants;
const int LOW = 0;
const int HIGH = 30;
int other = 0;
int dancer = 0;
int musician = 0;
int singer = 0;
WriteLine("**********************************");
WriteLine("* The stars shine in Greenville. *");
WriteLine("**********************************");
WriteLine("");
lastYearsContestants = getContestantsNum(message, LOW, HIGH);
string[] contestant = new string[thisYearsContestants];
string[] talent = new string[thisYearsContestants];
getContestantsInfo(contestant, talent);
for (int x = 0; x < talent.Length; ++x)
{
if (talent[x] == "O")
{
++other;
}
else if (talent[x] == "S")
{
++singer;
}
else if (talent[x] == "D")
{
++dancer;
}
else if (talent[x] == "M")
{
++musician;
}
}
Clear();
WriteLine("Currently signed up, there are..");
WriteLine("{0} dancers", dancer);
WriteLine("{0} singers", singer);
WriteLine("{0} musicians", musician);
WriteLine("{0} everything else!", other);
contestantByTalent(contestant, talent);
Clear();
contestantInfo(thisYearsContestants, lastYearsContestants, fee);
}
static int getContestantsNum(string message, int LOW, int HIGH)
{
WriteLine("Please enter the number of contestants for last year.>>");
string input = ReadLine();
int contestantsNum = Convert.ToInt32(input);
while (contestantsNum < LOW || contestantsNum > HIGH)
{
WriteLine("Valid numbers are 0 through 30, Please try again.>>");
contestantsNum = Convert.ToInt32(ReadLine());
}
return contestantsNum;
WriteLine("Please enter the number of contestants for this year.>>");
string input = ReadLine();
int contestantsNum = Convert.ToInt32(input);
while (contestantsNum < LOW || contestantsNum > HIGH)
{
WriteLine("Valid numbers are 0 through 30, Please try again.>>");
contestantsNum = Convert.ToInt32(ReadLine());
}
return contestantsNum;
}
static string getTalent(int contestantsNum)
{
bool correct = false;
string talentType = "";
while (!correct)
{
WriteLine("What is contestant " + contestantsNum + "'s skill? Please enter 'S' for Singer, 'D' for Dancer, 'M' for " +
"Musician, 'O' for Other.>>");
talentType = ReadLine().ToUpper();
if (talentType == "S" || talentType == "D" || talentType == "M" || talentType == "O")
{
correct = true;
}
else
{
WriteLine("Please enter a valid response.>>");
}
}
return talentType;
}
static void contestantByTalent(string[] contestant, string[] talent)
{
WriteLine ("To see a list of all contestants with a specific talent, Please enter a talent code.talent codes are(S)inger, (D)ancer, (M)usician, (O)ther; altenatively, you may type (E) to exit.>>");
string entry = ReadLine().ToUpper();
while (entry != "E")
{
if (entry != "S" && entry != "D" && entry != "M" && entry != "O")
{
WriteLine("That wasn't a valid talent code. Valid talent codes are (S)inger, (D)ancer, (M)usician, (O)ther; altenatively, you may type (E) to exit.>>");
entry = ReadLine().ToUpper();
if (entry == "E")
break;
}
for (int x = 0; x < talent.Length; ++x)
{
if (entry == talent[x])
WriteLine("Contestant " + contestant[x] + " talent " + talent[x]);
}
WriteLine("To see a list of all contestants with a specific talent, Please enter a talent code. talent codes are (S)inger, (D)ancer, (M)usician, (O)ther; altenatively, you may type (E) to exit.>>");
entry = ReadLine().ToUpper();
}
}
static void getContestantsInfo(string[] contestant, string[] talent)
{
for (int x = 0; x < contestant.Length; ++x)
{
WriteLine("What is the name for Contestant " + (x + 1) + "?");
contestant[x] = ReadLine();
talent[x] = getTalent(x + 1);
}
}
static void contestantInfo (int thisYearsContestants, int lastYearsContestants, int fee)
{
if (thisYearsContestants > lastYearsContestants * 2)
{
WriteLine("The competition is more than twice as big this year!");
WriteLine("The expected revenue for this year's competition is {0:C}", (thisYearsContestants * fee));
}
else
if (thisYearsContestants > lastYearsContestants && thisYearsContestants <= (lastYearsContestants * 2))
{
WriteLine("The competition is bigger than ever!");
WriteLine("The expected revenue for this year's competition is {0:C}", (thisYearsContestants * fee));
}
else
if (thisYearsContestants < lastYearsContestants)
{
WriteLine("A tighter race this year! Come out and cast your vote!");
WriteLine("The expected revenue for this year's competition is {0:C}.", (thisYearsContestants * fee));
}
}
}
Tamanika got a raise in her hourly pay, from $15.90 to $17.65. Find the percent increase
Pre-Test: Players on EverQuest II encounter Pizza Hut stores and can even order a pizza in real life using an in-game command. This is an example of
EverQuest II case is an example of a transactional ad.
What is transactional ad?
A transactional advertisement is a method of completing a financial transaction through an advertisement, without the need for the user / buyer to travel to the store.
Why does the example classify as transactional ad?
The EverQuest II case is an example of transactional ad because they implemented a command for players to complete a transaction (the purchase of a pizza) through an in-game command without having to go to the pizza shop.
Learn more about videogames in: https://brainly.com/question/11274464
What are 3 things message timing must include
Answer:
1)Message Timing. Another factor that affects how well a message is received and understood is timing. ...
2)Access Method. Access method determines when someone is able to send a message. ...
3)Flow Control. Timing also affects how much information can be sent and the speed that it can be delivered.
what is the difference between software hardware ???
Answer:
Some differences are written below:
Explanation:
Hardware refers to the physical components of the computer. You can see and touch it (keyboard, screen, mouse, monitor..etc..)
Computer Software is a programming code executed on a computer processor.We can see and also use the software but can’t touch them. (Ms Word, Excel, Power Point, Photoshop..etc..)
Hardware can't perform tasks without software. And Software can't be executed without software.
Hardware has four main categories: input device, output devices, storage, and internal components.
Software is divided into System software, Programming software and Application software.
Hardware is not affected by computer viruses. Software is affected by computer viruses.
Each road is associated with a value indicating the level of danger in maintaining that road during winter months. There are many subsets of roads such that the roads in such subsets keep the towns connected directly or indirectly. Each subset is assigned a cost of maintenance, which is directly proportional to the highest danger level of the road present in that subset. The engineer wants to select the smallest subset that keeps the towns connected directly or indirectly and that also has the lowest cost of maintenance. Develop an algorithm to find such a subset. Justify the correctness of your algorithm and derive its runtime.
Answer:
Each road is associated with a value indicating the level of danger in maintaining that road during winter months. There are many subsets of roads such that the roads in such subsets keep the towns connected directly or indirectly.
Sebutkan contoh komputer analog, komputer digital, dan komputer hybrid
Answer: the examples of analog computer is voltmeter
Example of digital computer is tablet,mobile etc
Example of hybrid computer is digital meters used nowadays in cars etc
Find the error and rewrite the code with the error fixed.
// INSTANCE VARIABLE
public class Main {
public static void main(String[] args) {
Product prod1 = new Product();
prod1.Barcode = 123456;
Product prod2 = new Product();
prod2.Barcode = 987654;
System.out.println(prod1.Barcode);
System.out.println(prod2.Barcode);
}
}
public class Product {
public int Barcode;
}
Answer:
Explanation:
1st mistake: Barcode is written with upeer case, that's not the convention for variables in java, only classes.
2nd: Barcode is public, it is convention to always leave variables private then create getters and setters in case you need to change the value but never acess the variable outside the class it belongs. Also the class should at least have a default constructor in case you are going to instantiate an object outside it.
so the product class should be:
--------------------------------------------------------------------
public class Product {
private int barcode;
public Product() {
// default constructor
}
public int getBarcode() {
return barcode;
}
public void setBarcode(int barcode) {
this.barcode = barcode;
}
}
-------------------------------------------------------------------------
3rd: in the main class now you can instantiate the 2 objects but you are gonna set the variable and get the value through the method, like this:
public class Main {
public static void main(String[] args) {
Product prod1 = new Product();
prod1.setBarcode(123456);
Product prod2 = new Product();
prod2.setBarcode(987654);
System.out.println(prod1.getBarcode());
System.out.println(prod2.getBarcode());
}
}
-----------------------------------------------------------------------------------
Assuming the 2 classes (main and product) are in the same package. But in case they are in different packages, just make sure to import the Product class into the Main class so that you can instantiante an object (new Product()) of it.
Problem: For multi access control, there are two approaches, those based on channel partitioning, and those based on random access. In packet switching, there are two rather similar approaches as well, namely, circuit switching and package switching. Discuss the similarities and differences in these two problem domains and the corresponding approaches g
The similarity between the two systems is the ability to connect many different communication devices and transfer data between a sender and a receiver. The main difference is the need for a connection for both to work.
We can arrive at this answer because:
Circuit and package quotation is very important for the connections of different communication devices.Furthermore, these two systems are used efficiently when a data transfer is required.However, even being used for the same purposes, they have many differences between them.The biggest difference is the need for a connection, as package switching is done without the need for a connection, while circuit switching needs a connection to act.In addition, circuit switching is more widely used because of its ability to transfer data from one point to another via message transfer, while package switching is used when circuit switching is not available as it does the sending data more slowly across one drive.
More information:
https://brainly.com/question/7227504