Answer:
Explanation:
The following code is written in Java. It is a function that takes in the ArrayList called ArrayBag as a parameter and randomly removes one of the elements in the ArrayList. As long as the ArrayBag has at least 1 element it will return true otherwise it will return false.
public static boolean removeRandom(ArrayList ArrayBag) {
Random rand = new Random();
if (ArrayBag.size() > 0) {
int randomNumber = rand.nextInt(ArrayBag.size());
ArrayBag.remove(randomNumber);
return true;
} else {
return false;
}
}
Topic: Pseudo-codes
Example 5
A shop sells books, maps and magazines. Each item is identified by a unique 4 –
digit code. All books have a code starting with a 1, all maps have a code starting
with a 2 and all magazines have a code beginning with a 3. The code 9999 is used
to end the program.
Write an algorithm using pseudocode which input the codes for all items in stock
and outputs the number of books, maps and magazine in stock. Include any
validation checks necessary.
(NOTE: A 4-digit code implies all books have a code lying between 1000 and
1999, all maps have a code lying between 2000 and 2999 and all magazines a code
lying between 3000 and 3999. Anything outside this range is an error)
Answer:
//program_start
//variable_inicialization
books = 0
maps = 0
magazines = 0
//End variable_inicialization
//operation_selection_routine
display "Select operation: (I) for input item to stock, (O) for output items in stock
operation = read_keyboard_input
IF (operation = "I")
goto input_routine
ELSE IF (operation = "O")
goto output_routine
ELSE
display "Incorrect option, try again"
goto operation_selection_routine
ENDIF
//End operation_selection_routine
//input_routine
display "Insert item code to add to stock"
input_code = read_keyboard_input
IF (input_code >= 1000 & input_code < 2000)
IF (input_code NOT duplicated_in_stock)
add_to_stock (input_code)
books = books + 1
display "Book added"
ELSE
display "Item Code is already present in stock"
ENDIF
ELSE IF (input_code >= 2000 & input_code < 3000)
IF (input_code NOT duplicated_in_stock)
add_to_stock (input_code)
maps = maps + 1
display "Map added"
ELSE
display "Item Code is already present in stock"
ENDIF
ELSE IF (input_code >= 3000 & input_code < 4000)
IF (input_code NOT duplicated_in_stock)
add_to_stock (input_code)
magazines = magazines + 1
display "Magazine added"
ELSE
display "Item Code is already present in stock"
ENDIF
ELSE IF (input_code = 9999)
goto program_end
ELSE
display "Incorrect option, try again"
goto input_routine
ENDIF
goto operation_selection_routine
//End input_routine
//output_routine
display "Items in stock"
display "Number of books: " + books
display "Number of maps: " + maps
display "Number of magazines: " + magazines
goto operation_selection_routine
//End output_routine
//program_end
display "Terminating stock program"
stop_program
Explanation:
Pseudo code is a way to design an algorithm using normal words and terms, that are not specific to any programming language. It is easier to understand how the program works and once finished, can be translated to the desired programming language.
This algorithm uses 5 blocks of code:
*variable_inicialization, where item counters are initially set to zero.
*operation_selection_routine, where the program request user input to select if the user will add an item or show existing items in stock. If an incorrect option is given, it will repeat this same routine.
*input_routine, the program will request the four digit code to add, and will check if it is not already present (to avoid duplicated items), and if the item code belongs to a book, map or magazine, increasing the corresponding item counter. Also, if the code is 9999 it will go to the program_end routine, otherwise it will display an error message and request a new item code. After a valid item code it will return to the operation_selection_routine.
*output_routine, it will display on screen the number of items for each category. Then, returns to the operation_selection_routine.
*program_end, it will simply display a goodbye message and terminate the program.
Write a function that will find the cost to send an international fax. The service charge is $7.00. It costs $0.45 per page for the first ten pages and $0.10 for each additional page. Take as parameter the number of pages to be faxed, and calculate the total amount due. The total amount due is returned to the main program.
Answer:
This function is written in python
def intlfax(pages):
if pages <=10:
fax = 7 + 0.45 * pages
else:
fax = 7 + 0.45 * 10 + 0.10 * (pages - 10)
return fax
Explanation:
This line defines the function
def intlfax(pages):
This checks if pages is less than or equal to 10 and calculates the fax
if pages <=10:
fax = 7 + 0.45 * pages
If otherwise, it also calculates the fax (differently)
else:
fax = 7 + 0.45 * 10 + 0.10 * (pages - 10)
This returns the calculated fax
return fax
long-term memory used by the computer:
Write two public static methods in the U6_L4_Activity_Two class. The first should have the signature swap(int[] arr, int i, int j) and return type void. This method should swap the values at the indices i and j of the array arr (precondition: i and j are both valid indices for arr). The second method should have the signature allSwap(int[] arr) and return type void. The precondition for this method is that arr has an even length. The method should swap the values of all adjacent pairs of elements in the array, so that for example the array {3, 5, 2, 1, 8, 10} becomes {5, 3, 1, 2, 10, 8} after this method is called.
Answer:
public static void swap(int[] arr, int i, int j) {
if(i >=0 && i <=arr.length-1 && j >=0 && j<=arr.length-1){
int hold = arr[i];
arr[i] = arr[j];
arr[j] = hold;
}
}
public static void allSwap(int[] arr) {
if (arr.length % 2 == 0){
for(int i=0; i<arr.length; i+=2){
int hold = arr[i+1];
arr[i+1] = arr[i];
arr[i] = hold;
}
} else{
System.out.println("array length is not even.");
}
}
Explanation:
The two functions, swap and allSwap are defined methods in a class. The latter swaps the item values at the specified index in an array while the second accepts an array of even length and swap the adjacent values.
write a technical term for following statements
1.The method applied to increase the life of computer and its assets.
2.The power regulating device this supplies constant power to the computer from its backup system.
3.The software used to scan, locate and detect the disk for viruses.
Answer:
1. Hardware Maintenance
2. Uninterrupted Power Supply (UPS)
3. Antivirus software
Explanation:
Antivirus software, or Anti-virus software (also known as AV software), otherwise called anti malware, is a PC program used to forestall, distinguish, and eliminate malware.
Antivirus software was initially evolved to identify and eliminate PC infections, thus the name. Be that as it may, with the expansion of different sorts of malware, antivirus software began to give security from other PC dangers. Specifically, current antivirus software can shield clients from: noxious program criminals.
A few items additionally incorporate security from other PC dangers, for example, tainted and noxious URLs, spam, trick and phishing assaults, online identity (privacy), web based financial assaults, social engineering techniques, advanced persistent threat (APT).
Ismael is examining a report in Access. He needs to access a view that will be used to examine and change the structure of the report, including the ability to add or modify controls. Which view should he choose?
Design
Layout
Print Preview
Report
Answer:
The answer is "Design"
Explanation:
Reports offer an approach to view, design, and sum up the data in your Microsoft Access information base. For instance, you can make a basic report of telephone numbers for every one of your contacts, or a rundown report on the absolute deals across various locales and You can make a wide range of reports in Access, going from the easy to the complex. Start by contemplating your report's record source.
Regardless of whether your report is a straightforward posting of records or a gathered rundown of deals by area, you should initially figure out which fields contain the information you need to find in your report, and in which tables or inquiries they reside.
How is DHTML different than semantic HTML?
Answer choices:
A group of web-related technologies.
Uses HTML tags to indicate the role a piece of text plays.
Creates websites with interactivity and animations.
Creates websites that adapt to different screen sizes.
Answer:
DHTML -> "A Group of web related technologys" and "creates websites with interactivity and animations"
HTML -> "creates websites that adapt to different screen sizes" and "uses HTML tags to indicate the rolea piece of text plays"
The part of the operating system that
manages (part of the memory
hierarchy is called the
a.)memory disk
b.)memory space
c.)memory manager
d.)address table
Answer:
C.
Explanation:
Memory Management can be defined as a management process in computer science which helps in managing and controlling computer memory. This process also allocates blocks to several programs running in order to improve overall system. Memory management is located in hardware, OS, and applications.
This program also assits OS by providing additional assisstance such as it helps to remove unused data of memory, etc. Some examples of memory manager are cacheman, WinRam, etc.
Therefore, option C is correct.
Your organization has hired a penetration tester to validate the security of your environment. The penetration tester needs to document which ports are being listened on for the various servers. Which type of tool will the penetration tester most likely use
Answer:
Port scanner
Explanation:
The penetration tester would most likely use a port scanner. A port scanner can be explained to be an application that is made to check a server or host for ports that are open. This application can also be used by administrators to check their security networks so as to know those network services that are running on a host and also to know existing vulnerabilities. Attackers also use this to exploit victims.
Is there anyone that knows how to work in Microsoft Access and someone that could help me on my test at 11 30am?
Answer:
ok i help you i like it 11:30 ok
Which sentence is an effective example of language for the following scenario?
Aaron's coworker Bryce has not been working on the team project their boss assigned them.
Answer:
"I feel like this assignment isn't a priority to you"
Explanation:
Given that I-language is a term used in the depicting or forming individuals' perception or point of view of a given situation or statement instead of the actual statement. It is fully known as Internal language.
Hence, in this case, the term "Aaron's coworker Bryce has not been working on the team project their boss assigned them, " can be translated into "I feel like this assignment isn't a priority to you" in I-Language.
) For a course with n students, an n X 3 array, int[][] arr, holds scores on 3 exams. Each row holds the exam scores for one student, one exam per column. Write code to get the average of cumulative exam score, over all students. For instance, if student1 scored 50,60,65 in the three exams, and student2 scored 75,85,90, then the cumulative exam score for student1 is 175 and that for student2 is 250, and the resulting average is 212.5
Answer:
Following are the code to this question:
import java.util.*;//import package
public class Main //defining a class
{
public static void main(String[] ax)//defining main method
{
int student[][] = {{50,60,65},{75,85,90}}; //defining double array student
int Row=0,Col=0;//defining integer variable
double x;//defining double variable
for (int a = 0; a <student.length; a++)//use for loop to holding row value
{
for (int b = 0; b<student[a].length; b++)//use for loop to holding column value
{
Row += student[a][b];//add row value
Col += student[0][b];//add column value
}
}
System.out.println(x=Row/2);//dividing value and calculating average value
}
}
Output:
212.0
Explanation:
In the above code, a 2D array student is declared, that holds some value in the next step, two integer variable "Row and Col", is declared, which it uses the for loop to add value in "Row and Col", and in the next step, a double variable x is declared, that add value and calculates its average value and store its value in x variable and print its value.
Answer:
3.14159265358979323846264338327950288419716939937510 582097494459230781640628620899 86280348253421170679
Explanation:
What are the two types of programming languages?
Answer:
High level language.
Low level language
Explanation:
please give brainliest
What reforms were made by the British government in India after the war of independence? write any three
PLEASE I NEED HELP AS FAST AS YOU CAN
Answer:
1. Indian Council Act
2. Morely-Minto Reforms
3. Rowlatt Act
Explanation:
Following the unsuccessful war of independence in Indian often referred to as the Indian Rebellion of 1857. There were various reforms established by the British government before the actual independence of India in 1947. Some of the reforms include:
1. Indian Council Act: this was established in 1861 under the regime of Lord Canning. The purpose is to contemplate an association of Indians with the administration at a higher level.
2. Morely-Minto Reforms: this was established in 1909 under the reign of Lord Minto II. The purpose is to Separate electorates to widen the gulf between Hindús and Muslims.
3. Rowlatt Act: this was established in 1919 under the administration of L. Chelmsford. These reforms favor the extraordinary powers given to suppress the freedom struggle with General Dyer as the Commandant.
Use the drop-down menus to select the software term being described. The is what the user interacts with when operating a computer. The is the most important computer software. The is the software located within the hardware.
Answer:
1.) A. application software
2.) C. operating system
3.) B. basic input/output system
Answer:
All of his are correct :)
Explanation:
When you are ready to print your document, what tab and command should you choose from the menu?
File, Print
File, Open
Home, Print
Home, New
Answer:
File, Print UWU
Explanation:
Answer:
file,print i took the test a while ago
Explanation:
Create a 100-word internet company
Answer:
The World Wide Web.
Explanation:
The World Wide Web was created at CERN in Switzerland in 1990. Today, people can pay money to access the Internet from internet service providers.
Hope this helps!
xoxo,
cafeology
Which of the following can help organize your email messages? Select all that apply.
A. flagging actionable emails
B. adding folders for specific projects
C. filtering out spam or newsletters
D. marking all emails as unread
Answer: A and B
Explanation: I took the test and got it right
The steps which can help organize your email messages are:
B. Adding folders for specific projects C. Filtering out spam or newslettersAccording to the given question, we are asked to show the proper steps which a user can take in order to organize his email messages.
As a result of this, we can see that the steps which can help a user to organize his email messages are to add folders for specific projects so that he can easily access them and to filter out spam or newsletters from important mail.
Therefore, the correct answers are options B and C
Read more here:
https://brainly.com/question/2594338
help me please .
and thank you ..
Explanation:
Write a program that gets a list of integers from a user. First, the user should be asked to enter the number of integers to be stored in a list. Then your program should ask for these integers and store them in the list. Finally, the program should ask the user to enter a sentinel value that will be used to search through the integers in the list which are greater than the sentinel value. For example: If the input is: 7 50 60 140 200 75 100 172 70 the output is: 140 200 75 100 172 The 7 indicates that there are seven integers in the list, namely 50 60 140 200 75 100 172. The 70 indicates that the program should output all integers greater than 70, so the program outputs 140 200 75 100 172. You should use methods in addition to the main method. getListValues to get and store the values from the user printListValuesGreaterThanSentinal to print the values found to be greater than the sentinel value.
Answer:
#include <iostream>
using namespace std;
void insert(int *arr, int num);
int n;
void returnGT(int arr[]);
int main(){
cout<< "Enter the number of integers: "<<endl;
cin>>n;
int num[n];
insert(num, n);
returnGT(num);
}
void insert(int *arr, int num){
for (int i = 0; i < num; i++){
cout<< "Enter item "<< i + 1 << " : ";
cin>> arr[i];
}
}
void returnGT(int arr[]){
int sentinel;
cout<< "Enter sentinel: ";
cin>> sentinel;
for (int i = 0; i < n; i++){
if (arr[i] > sentinel){
cout<< arr[i] << " ";
}
}
}
Explanation:
The C++ source code defines an array of integer values, the program prompts for user input for the array size and the sentinel value to fill the array with input values and output integer values greater than the sentinel.
Create a program that will output the sum of the prime numbers ( 2 - 100). A prime number is a number greater than 1 that cannot be formed by multiplying two smaller natural numbers. some prime numbers are: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37... Example: Find the total sum of prime numbers from 1 - 100 The total sum is 1060. Verify your answers.
Answer:
The attached file is a C program that does much of what you want. It does not output the the sum of the primes, but lists the primes. The output is simple enough to change. This program builds quite easily with GCC.
I don't know what language you're using, so I'm just providing a piece of code I've written that might help you out.
Also:
There are a few tricks in searching for prime numbers. Here are some that I always like to take into account.
1) With the exception of 2 and 3, all primes are one away from a multiple of six
2) When testing a number for divisibility, you only have to test up as far as its square root.
3) You don't need to test for divisibility by composite numbers. Only prime factors are needed. Any composite numbers smaller than x will be multiples of primes smaller than x.
So you can very rapidly find primes with a loop that starts at 6, and goes up to whatever limit you want, incrementing by 6. Let's call the number of that loop x. You then only have to test if the x - 1 is prime and if x + 1 is prime. That eliminates 2/3 of the iterations needed. Also, when you find primes, put them in an array. I would start by creating an array with the numbers 2 and 3 already in it (those being the only two primes that are not adjacent to a multiple of six). Then each number tested only needs to be checked for divisibility by numbers in that array that are less than or equal to the square root of the number being tested. If the number is composite, then it is only divisible by something larger than its square root if it is also divisible by something smaller than its square root.
With all of this big blurb written, and some hard-to-read C code attached, if you're just looking to write something quick to do your homework, and don't care about it being efficient, you can just do something like this javascript style example:
var n, tally = 0, list = [], isPrime;
for(n = 2; n < 100; n++){
isPrime = 1;
for(m = 0; m < list.length && list[m] <= Math.sqrt(n) && isPrime; m++){
if(n % list[m] == 0) isPrime = 0;
}
if(isPrime){
list[list.length] = n;
tally += n;
}
}
console.log('sum of primes: ' + tally);
I haven't run that code, so do watch out for any errors I missed. Good luck!
We have constructed a Player Class for you. Add the following: public static variable: int totalPlayers Static variable should be an int. The value should be incremented whenever a new Player is constructed. public static variable: int maxPlayers Static variable should be an int. Set its value to 10. public static method: gameFull() The gameFull() static method should return a boolean of whether the total players is greater than or equal to the maxPlayers static variable.
Answer:
public class Player {
public static int totalPlayers = 0;
public static int maxPlayers = 10;
public static boolean gameFull() {
return totalPlayers >= maxPlayers;
}
public Player() { // Player class constructor
totalPlayers++;
}
}
Explanation:
The Java program defines the class Player which has two public class variables and a public method. The class constructor increases the totalPlayer variable by one for every player object created.
Climatologist use weather balloons, stethoscopes, and satellites true or false
Answer:
False.
Explanation:
A stethoscope is a medical instrument which is used for listening to the work of the heart and lungs. It consists of a microphone that rests on the patient's chest, and rubber tubes that bring the sound to the earphones. An ordinary stethoscope does not have any moving or electrical parts, as it only mechanically conducts sound from the patient's chest to the doctor's ear. One of the simplest examinations that doctors perform today is listening to the lungs and heart with a stethoscope. With the help of this instrument, noises are heard during the work of the lungs and heart.
A business should send messages over a social network in which of the following ways? Select all that apply.
I could help better if you could give the list of what the social networks were, other than that I don't think anyone could help you even if the wanted to.
Answer:
post customer testimonials, respond to a customer's complaint and promote upcoming events
Explanation:
Each of the following is a component of the telecommunications industry except _____.
spreadsheets
wired communications
broadcasting
HDTV
Identify the data model used in each scenario.
A database of contestants in a dog show where each dog, owner, and competition is identified by a primary key
A database that stores detailed information on the taxonomy of living things found in a geographical area, including the categories of kingdom, phylum, class, order, family, genus, and species
A database used to catalog types of architecture, geographical features, and sociological characteristics in various parts of the world
A database used to cross-reference actors who have performed in various movies with directors, writers, and other support staff for those movies
Answer:
Relational databaseObject-oriented databaseHierarchical databaseNetwork databaseExplanation:
The relational database has always been recognized or identified as well as using the primary key. The object database would be where the documentation has always been displayed as such an object. This same hierarchical database would be a type of database these have links to something else with either a connection. Network database does indeed have a cross-reference where this component should be pass to some other.Consider the following code segments, which are each intended to convert grades from a 100-point scale to a 4 point scale and print the result. A grade of 90 or above should yield a 4.0, a grade of 80 to 89 should yield a 3.0, grade of 70 to 79 should yield a 20, and any grade lower than 70 should yield a 0.0 Assume that grade is an int variable that has been properly declared and initialized Code Segmenti double points = 0.0; ir (grade > 89) points 4.0; else if (grade > 79) points + 3.0; else if (grade > 69) points += 2.0; else points + 0.0; System.out.println (points); Code Segment II double points - 0.0; if (grade > 89) points + 4.0; if (grade > 79) grade 3.0; if (grade > 69) points - 2.0; if (grade points + 0.01 System.out.println (points); Which of the following statements correctly compares the values printed by the two methods? A. The two code segments print the same value only when grade is below 80. B. The two code segments print the same value only when grade is 90 or above or grade is below 80. C. The two code segments print the same value only when grade is 90 or above. D. Both code segments print the same value for all possible values of grade E. The two code segments print different values for all possible values of grade.
Answer:
A. The two code segments print the same value only when the grade is below 80.
Explanation:
The first code segment defines a nested if-else statement with the different grade categories to compare and print and would only print one value for a given grade range. The second code segment defines several if statements for each grade range and can add multiple values to the points variable for one grade range that meets the condition.
Both code segments would only print out the same values of points for a grade range below 80.
What is the purpose of a report?
A. To organize data into a table
B. To display data returned from a query in a specially formatted way
C. To design a custom form to create a new table
D. To search for specific information in a table
Answer:
B. To display data returned from a query in a specially formatted way
Outline three requirements for linear programming
Which of the following is true about binary search. A. It uses binary numbers in its algorithm B. It is slower than sequential search C. It can be implemented using a recursive algorithm D. It does works for both sorted and unsorted arrays. E. None of the above.
Answer:
A. It uses binary numbers in its algorithm
Explanation:
A Binary search is a type of algorithm designed to look through only a sorted array of data for a particular item.
It is more efficient (faster) than sequential search since the algorithm doesn't have to look up the entire array of data, but simply repeatedly divide in half the section of the array that could contain the searched item.