Answer:
Explanation:
The following code is written in Java. It creates the abstract dollar class that has two instance variables for the dollars and the coins that are passed as arguments. The test output can be seen in the picture attached below.
class Dollar {
int dollars;
double coin;
private Dollar(int dollar, int coin) {
this.dollars = dollar;
this.coin = Double.valueOf(coin) / 100;
}
}
At the beginning of the semester, we studied partially filled arrays. This is when the number of elements stored may be less than the maximum number of elements allowed. There are two different ways to keep track of partially filled arrays: 1) use a variable for the numberElements or 2) use a sentinel (terminating} value at the end of elements (remember c-strings?). In the code below, please fill in the details for reading the values into the an array that uses a sentinel value of -1. Complete the showArray function as well.
#include
using namespace std;
void showArray(int array[]);
// ToDo: Code showArray function with one array parameter
int main()
{
const int MAX_SIZE=16;
int array[MAX_SIZE]; // store positive values, using -1 to end the values.
cout <<"Enter up to " << MAX_SIZE-1 << " positive whole numbers, use -1 to stop\n";
//To do: Read the int values and save them in the static array variable.
// When the user enters -1 or the array has no more room, leave the loop..
//To do: store -1 at the end of elements in the array
// Show array function
showArray(array);
return 0;
}
// To do: print out for the array
void showArray(int array[])
{
}
Answer:
Complete the main as follows:
int num;
cin>>num;
int i = 0;
while(num!=-1 && i <16){
array[i] = num;
cin>>num;
i++; }
array[i+1] = -1;
The showArray() as follows:
int i =0;
while(array[i]!=0){
cout<<array[i]<<" ";
i++;
}
Explanation:
See attachment for complete program where comments are used to explain difficult lines
If not cleared out, log files can eventually consume a large amount of data, sometimes filling a drive to its capacity. If the log files are on the same partition as the operating system, this could potentially bring down a Linux computer. What directories (or mount points) SHOULD be configured on its own partition to prevent this from happening?
Answer:
/var
Explanation:
The /var subdirectory contains files to which the system writes data during the course of its operation. Hence, since it serves as a system directory, it would prevent log files from consuming a large amount of data.
Answer:
/var
Explanation:
Hope this helps
Describe how data is shared by functions in a procedure- oriented program
You are the IT administrator for a small corporate network. You have just changed the SATA hard disk in the workstation in the Executive Office. Now you need to edit the boot order to make it consistent with office standards. In this lab, your task is to configure the system to boot using devices in the following order: Internal HDD. CD/DVD/CD-RW drive. Onboard NIC. USB storage device. Disable booting from the diskette drive.
Answer:
this exercise doesn't make sense since I'm in IT
Explanation:
what is work immersion and its nature
Write a client program ClientSorting2 and in the main() method: 1. Write a modified version of the selection sort algorithm (SelectionSorter()) that sorts an array of 23 strings (alphabetically) rather than one of integer values. Print the array before it is sorted in the main() method, then after it is sorted in SelectionSorter().
Answer:
The program in Java is as follows:
import java.util.*;
public class Main{
public static void SelectionSorter(String[] my_array){
System.out.print("\nAfter sort: ");
for (int ind=0; ind < 22; ind++ ){
int min = ind;
for (int k=ind+1; k < 23; k++ )
if (my_array[k].compareTo(my_array[min] ) < 0 ){ min = k; }
String temp = my_array[ind];
my_array[ind] = my_array[min];
my_array[min] = temp; }
for (int j=0; j < 23; j++){ System.out.print(my_array[j]+" ");}
}
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String [] myarray = new String [23];
for(int i= 0;i<23;i++){ myarray[i] = input.nextLine(); }
System.out.print("Before sort: ");
for ( int j=0; j < 23; j++ ){ System.out.print(myarray[j]+" "); }
SelectionSorter(myarray);
}
}
Explanation:
This defines the function
public static void SelectionSorter(String[] my_array){
This prints the header for After sort
System.out.print("\nAfter sort: ");
This iterates through the array
for (int ind=0; ind < 22; ind++ ){
This initializes the minimum index to the current index
int min = ind;
This iterates from current index to the last index of the array
for (int k=ind+1; k < 23; k++ )
This compares the current array element with another
if (my_array[k].compareTo(my_array[min] ) < 0 ){ min = k; }
If the next array element is smaller than the current, the elements are swapped
String temp = my_array[ind];
my_array[ind] = my_array[min];
my_array[min] = temp; }
This iterates through the sorted array and print each array element
for (int j=0; j < 23; j++){ System.out.print(my_array[j]+" ");}
}
The main begins here
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
This declares the array
String [] myarray = new String [23];
This gets input for the array elements
for(int i= 0;i<23;i++){ myarray[i] = input.nextLine(); }
This prints the header Before sort
System.out.print("Before sort: ");
This iterates through the array elements and print them unsorted
for ( int j=0; j < 23; j++ ){ System.out.print(myarray[j]+" "); }
This calls the function to sort the array
SelectionSorter(myarray);
}
}
Write a Java program that uses a value-returning method to identify the prime numbers between 2 bounds (input from the user). The method should identify if a number is prime or not. Call it in a loop for all numbers between the 2 bounds and display only prime numbers. Check for errors in input.Note:A number is prime if it is larger than 1 and it is divisible only by 1 and itself(Note: 1 is NOT a prime number)Example:15 is NOT prime because 15 is divisible by 1, 3, 5, and 15; 19 is prime because 19 is divisible only by 1 and 19.
Answer:
Answered below.
Explanation:
public int[] primeNumbers(int lowBound, int highBound){
if(lowBound < 0 || highBound < 0 || lowBound >= highBound){
System.out.print("invalid inputs");
else if(highBound <= 1){
System.out.print("No prime numbers);
}
else{
int[] nums;
for(int I = lowBound; I <= highBound; I++){
if(isPrime (I)){
nums.add(I);
}
}
return nums;
}
Select the correct answer.
Which graphic file format is used for commercial purposes?
OA.
TIFF
B.
GIF
C. JPG
OD.
PNG
O E.
BMP
Dat
Answer:
png or jpg
Explanation:
Activity No.5
Project Implementation
Based on the Community Based Results, proposed programs/project to be implemented in your barangay/community
I. Title
II Project Proponents
III Implementing Proponents
IV Project Duration
V Objectives of the Project
VI Project Description
VII Methodology
VIIIDetailed Budgetary Requirements
IX Gantt Chart/ Detailed schedule of activities
In the activity related to Project Implementation, the following components are listed:
I. Title: This refers to the name or title given to the proposed program or project to be implemented in the barangay/community.
II. Project Proponents: These are the individuals or groups who are responsible for initiating and advocating for the project. They may include community leaders, organizations, or individuals involved in the project.
III. Implementing Proponents: These are the parties or organizations who will be responsible for executing and implementing the project on the ground. They may include government agencies, non-profit organizations, or community-based organizations.
IV. Project Duration: This refers to the estimated timeframe or duration within which the project is expected to be completed. It helps in setting deadlines and managing the project timeline.
V. Objectives of the Project: These are the specific goals or outcomes that the project aims to achieve. They define the purpose and desired results of the project.
VI. Project Description: This section provides a detailed explanation and overview of the project, including its background, context, and scope.
VII. Methodology: This outlines the approach, methods, and strategies that will be used to implement the project. It may include activities, processes, and resources required for successful project execution.
VIII. Detailed Budgetary Requirements: This section provides a comprehensive breakdown of the financial resources needed to implement the project. It includes estimates of costs for personnel, materials, equipment, services, and other relevant expenses.
IX. Gantt Chart/Detailed Schedule of Activities: This visual representation or detailed schedule outlines the specific activities, tasks, and milestones of the project, along with their respective timelines and dependencies.
These components collectively form a framework for planning and implementing a project, ensuring that all necessary aspects are addressed and accounted for during the execution phase.
For more questions on barangay, click on:
https://brainly.com/question/31534740
#SPJ8
Which of the following best describes the safety of blogging
Generally safe, but there may be some privacy and security concerns. Therefore option B is correct.
While blogging can offer a relatively safe platform for expressing ideas and connecting with an audience, it is not entirely risk-free.
Privacy and security concerns can arise, especially when bloggers share personal information or discuss sensitive topics.
Cybersecurity threats, such as hacking or data breaches, can also compromise a blogger's personal information or their readers' data.
Additionally, bloggers should be mindful of online harassment and potential legal issues related to content ownership or copyright infringement.
Being aware of these risks and implementing best practices for online safety can help ensure a more secure and enjoyable blogging experience.
Therefore option B is correct.
Know more about Cybersecurity:
https://brainly.com/question/31928819
Your question is incomplete, but most probably your full question was.
Which of the following best describes the safety of blogging?
A. Completely safe, with no risks involved.
B. Generally safe, but there may be some privacy and security concerns.
C. Moderately safe, but potential risks exist, especially with sensitive topics.
D. Highly unsafe, with significant risks to personal information and security.
# change amount as an integer input, and output 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
my code produces no output and i cant find why?
coin_change =int(input())
def coin_change(cents):
if cents <= 0:
print( 'Zero cents.')
else:
quarter = cents // 25
dime = (cents % 25) //10
nickle = cents % 25 % 10 // 5
penny = cents % 5
print (coin_change )
# produces no output
Answer:
Explanation:
The Python code provided was not producing any output because you were never printing out the coin variables that you created. The following code adds the needed print statements using the right singular or plural coin name as needed.
cents = int(input())
def coin_change(cents):
if cents <= 0:
print('Zero cents.')
else:
quarter = cents // 25
dime = (cents % 25) // 10
nickle = cents % 25 % 10 // 5
penny = cents % 5
if quarter == 0 or quarter > 1:
print(str(quarter) + " quarters")
else:
print(str(quarter) + " quarter")
if dime == 0 or dime > 1:
print(str(dime) + " dimes")
else:
print(str(dime) + " dime")
if nickle == 0 or nickle > 1:
print(str(nickle) + " nickels")
else:
print(str(nickle) + " nickel")
if penny == 0 or penny > 1:
print(str(penny) + " pennies")
else:
print(str(penny) + " penny")
coin_change(cents)
is a general-purpose computing device?
Answer: I think so
Explanation: All mainframes, servers, laptop and desktop computers, as well as smartphones and tablets are general-purpose devices. In contrast, chips can be designed from scratch to perform only a fixed number of tasks, but which is only cost effective in large quantities (see ASIC).
Please give brainliest not this file virus exploiter
HELP ASAP DONT ANSWER WITH A LINK
Answer:
Layout
title
title and content
section header
comparison
Orientation
landscape
portrait
How many outcomes are possible in this control structure?
forever
if
is A button pressed then
set background image to
else
set background image to
Answer:
In the given control structure, there are two possible outcomes:
1) If the condition "Is A button pressed?" evaluates to true, then the background image will be set to a specific value.
2) If the condition "Is A button pressed?" evaluates to false, then the background image will be set to another value.
Therefore, there are two possible outcomes in this control structure.
Hope this helps!
what is the correct sequence in which a computer operates
Answer:
Booting is a startup sequence that starts the operating system of a computer when it is turned on. A boot sequence is the initial set of operations that the computer performs when it is switched on. Every computer has a boot sequence.
Given a number count the total number of digits in a number
Answer:
round up the log of the number
Explanation:
The ¹⁰log of a number gives you the number of digits if you round it up.
In "PUBATTLEGROUNDS” what is the name of the Military Base island?
Answer:
Erangel
Explanation:
Answer:
Erangel
Explanation:
The Military Base is located on the main map known as Erangel. Erangel is the original map in the game and features various landmarks and areas, including the Military Base.
The Military Base is a high-risk area with a significant amount of loot, making it an attractive drop location for players looking for strong weapons and equipment. It is situated on the southern coast of Erangel and is known for its large buildings, warehouses, and military-themed structures.
The Military Base is a popular destination for intense early-game fights due to its high loot density and potential for player encounters.
Hope this helps!
Which database item would show details such as a customer’s name, their last purchase, and other details about a customer?
A. file
B. field
C. record
D. table
E. index
Answer:
The answer is C. Record
Explanation:
Which of the following operating systems would allow a user to add functionality and sell or give away their versions?
Answer:open source
Explanation: what is's called
Linux is the operating systems would allow a user to add functionality and sell or give away their versions.
What is Linux Operating system?Linux has been defined as known to be a kind of an an Operating system which is known to be an open-source. It is one that is compared to Unix-like form of operating system but it is one that is often based on the the use of Linux kernel.
It has been said that to be an operating system kernel that was said to be released in 1991, by Linus Torvalds. Linux is said to be one that is often packaged as a service of a Linux distribution.
Linux has been used in a lot of ways such as the Server OS that is made for web servers, database servers, as well as file servers. They are known to be set up to aid high-volume as well as multithreading applications and also used for a lot of server types.
Therefore, Linux is the operating systems would allow a user to add functionality and sell or give away their versions. Hence, option A is correct.
Learn more about Linux on:
brainly.com/question/12853667
#SPJ2
Which of the following operating systems would allow a user to add functionality and sell or give away their versions?
-Linux
-macOS
-Windows
-UNIX
Define an application program and give three of it's uses
Answer:
please give me brainlist and follow
Explanation:
Examples of an application include a word processor, a spreadsheet program, an accounting application, a web browser, an email client, a media player, a console game, or a photo editor. The collective noun application software refers to all applications collectively.
Ineeedd help please 35 points question
Answer:
1
Explanation:
The four gates on the left are XNOR gates, their output is 1 if both inputs are equal. This is the case (given), so all inputs to the quadruple AND gate are 1, hence the output is also one.
Which of the following will display a string whose address is in the dx register: a.
mov ah, 9h
int 21h
b.
mov ah, 9h
int 22h
c.
mov ah, 0h
int 21h
d.
None of these
e.
mov ah, 2h
int 20h
Answer:
a)
Explanation:
Function 9 of interrupt 21h is display string.
mips Write a program that asks the user for an integer between 0 and 100 that represents a number of cents. Convert that number of cents to the equivalent number of quarters, dimes, nickels, and pennies. Then output the maximum number of quarters that will fit the amount, then the maximum number of dimes that will fit into what then remains, and so on. If the amount entered is negative, write an error message and quit. Amounts greater than 100 are OK (the user will get many quarters.) Use extended assembly instructions and exception handler services.
Answer:
Explanation:
The following code is written in python and divides the amount of cents enterred in as an input into the correct amount of quarters, dimes, nickels and pennies. Finally, printing out all the values.
import math
#First we need to define the value of each coin
penny = 1
nickel = 5
dime = 10
quarter = 25
#Here we define the variables to hold the max number of each coin
quarters = 0
dimes = 0
nickels = 0
pennys = 0
cents = int(input("Please enter an amount of money you have in cents: "))
if cents > 0 and cents <= 100:
if cents >= 25:
quarters = cents / quarter
cents = cents % quarter
if cents >= 10:
dimes = cents/dime
cents = cents % dime
if cents >= 5:
nickels = cents /nickel
cents = cents % nickel
if cents > 0:
pennys = cents / penny
cents = 0
print("The coins are: "
"\nQuarters", math.floor(quarters),
"\nDimes", math.floor(dimes), "\nNickels", math.floor(nickels), "\nPennies", math.floor(pennys))
else:
print("wrong value")
Scrabble is a word game in which words are constructed from letter tiles, each letter tile containing a point value. The value of a word is the sum of each tile's points added to any points provided by the word's placement on the game board. Write a program using the given dictionary of letters and point values that takes a word as input and outputs the base total value of the word (before being put onto a board). Ex: If the input is: PYTHON the output is: 14
Complete question:
Scrabble is a word game in which words are constructed from letter tiles, each letter tile containing a point value. The value of a word is the sum of each tile's points added to any points provided by the word's placement on the game board. Write a program using the given dictionary of letters and point values that takes a word as input and outputs the base total value of the word (before being put onto a board). Ex: If the input is: PYTHON
the output is: 14
part of the code:
tile_dict = { 'A': 1, 'B': 3, 'C': 3, 'D': 2, 'E': 1, 'F': 4, 'G': 2, 'H': 4, 'I': 1, 'J': 8, 'K': 5, 'L': 1, 'M': 3, 'N': 1, 'O': 1, 'P': 3, 'Q': 10, 'R': 1, 'S': 1, 'T': 1, 'U': 1, 'V': 4, 'W': 4, 'X': 8, 'Y': 4, 'Z': 10 }
Answer:
Complete the program as thus:
word = input("Word: ").upper()
points = 0
for i in range(len(word)):
for key, value in tile_dict.items():
if key == word[i]:
points+=value
break
print("Points: "+str(points))
Explanation:
This gets input from the user in capital letters
word = input("Word: ").upper()
This initializes the number of points to 0
points = 0
This iterates through the letters of the input word
for i in range(len(word)):
For every letter, this iterates through the dictionary
for key, value in tile_dict.items():
This locates each letters
if key == word[i]:
This adds the point
points+=value
The inner loop is exited
break
This prints the total points
print("Points: "+str(points))
Answer:
Here is the exact code, especially if you want it as Zybooks requires
Explanation:
word = input("").upper()
points = 0
for i in range(len(word)):
for key, value in tile_dict.items():
if key == word[i]:
points+=value
break
print(""+str(points))
Your organization, which sells manufacturing parts to companies in 17 different countries, is in the process of migrating your inventory database to the cloud. This database stores raw data on available inventory at all of your company's warehouses globally. The database will be accessible from multiple cloud-based servers that reside on your cloud provider's hardware located in three regions around the world. Each redundant database will contain a fully synchronized copy of all data to accelerate customer access to the information, regardless of the customer's geographical location.What database trend is your company implementing
Answer:
Disributed database
Explanation:
A distributed database stores data on multiple servers sometimes placed in distinct geographical locations.
Write a program that lets the user enter the loan amount and loan period in number of years and displays the monthly and total payments for each interest rate starting from 5% to 8%, with an increment of 1/8.
Answer:
Following are the code to this question:
import java.util.*;//import package
public class Main //defining a class
{
public static void main(String[] axc)//main method
{
double Loan_Amount,years,Annual_Interest_Rate=5.0,Monthly_Interest_Rate,Total_Amount,Monthly_Payment;//defining variables
Scanner ax = new Scanner(System.in);//creating Scanner class object
System.out.print("Enter loan amount:");//print message
Loan_Amount = ax.nextDouble();//input Loan_Amount value
System.out.print("Enter number of years: ");//print message
years= ax.nextInt();//input number of years value
System.out.printf(" %-20s%-20s%-20s\n", "Interest Rate", "Monthly Payment","Total Payment");//print message
while (Annual_Interest_Rate <= 8.0) //use while loop to calculate Interest rate table
{
Monthly_Interest_Rate = Annual_Interest_Rate / 1200;//calculating the interest Rate
Monthly_Payment = Loan_Amount * Monthly_Interest_Rate/(1 - 1 / Math.pow(1 + Monthly_Interest_Rate,years * 12));//calculating monthly payment
Total_Amount = Monthly_Payment * years * 12;//calculating yearly Amount
System.out.printf("\t %-19.3f%-19.2f%-19.2f\n", Annual_Interest_Rate,Monthly_Payment,Total_Amount);//use print meethod to print table
Annual_Interest_Rate = Annual_Interest_Rate + 1.0 / 8;//use Annual_Interest_Rate to increating the yearly Rate
}
}
}
Output:
Please find the attached file.
Explanation:
In this code inside the class, several double variables are declared in which the "Loan_Amount and years" is used for input value from the user-end, and another variable is used for calculating the value.
In this code a while loop is declared that checks the "Annual_Interest_Rate" value and creates the interest rate table which is defined in the image file please find it.
You work for a small company that exports artisan chocolate. Although you measure your products in kilograms, you often get orders in both pounds and ounces. You have decided that rather than have to look up conversions all the time, you could use Python code to take inputs to make conversions between the different units of measurement.
You will write three blocks of code. The first will convert kilograms to pounds and ounces. The second will convert pounds to kilograms and ounces. The third will convert ounces to kilograms and pounds.
The conversions are as follows:
1 kilogram = 35.274 ounces
1 kilogram = 2.20462 pounds
1 pound = 0.453592 kilograms
1 pound = 16 ounces
1 ounce = 0.0283 kilograms
1 ounce = 0.0625 pounds
For the purposes of this activity the template for a function has been provided. You have not yet covered functions in the course, but they are a way of reusing code. Like a Python script, a function can have zero or more parameters. In the code window you will see three functions defined as def convert_kg(value):, def convert_pounds(value):, and def convert_ounces(value):. Each function will have a block showing you where to place your code.
Answer:
Answered below.
Explanation:
def convert_kg(value){
ounces = value * 35.274
pounds = value * 2.20462
print("Kilograms to ounces: $ounces")
print("Kilograms to pounds: $pounds)
}
def convert_pounds(value){
kg = value * 0.453592
ounce = value * 16
print("pounds to kg; $kg")
print ("pounds to ounce; $ounce")
}
def convert_ounces(value){
kg = value * 0.0283
pounds = value * 0.0625
print ("ounces to kg; $kg")
print ("ounces to pounds; $pounds")
}
whats the most popular social networking in the philippines?
Y o u t u b e
It wont let me say the word above
palindrome is a string that reads the same forwards as backwards. Using only a xed number of stacks, and a xed number of int and char variables, write an algorithm to determine if a string is a palindrome. Assume that the string is read from standard input one character at a time. The algorithm should output true or false as appropriate
Solution :
check_palindrome[tex]$(string)$[/tex]
lower_[tex]$case$[/tex]_string[tex]$=$[/tex] string[tex]$. to$[/tex]_lower()
Let stack = new Stack()
Let queue = new Queue();
for each character c in lower_case_string:
stack.push(c);
queue.enqueue(c);
let isPalindrome = true;
while queue is not empty {
if (queue.remove().equals(stack.pop())) {
continue;
} else {
isPalindrome=false;
break while loop;
}
}
return isPalindrome
Input = aabb
output = true
input =abcd
output = false
Write one line Linux command that performs the required action in each of the problems given below: (a) Find the difference in text between two text files File1.txt and File2.txt and save the result in a file named result.txt (b) Change the permissions of the file remote_driver.c such that the owner has the permissions to read, write and execute and anybody other than the owner can only read the file but cannot write or execute. (c) Search for the string ir_signal in the file /home/grad/remote_driver.c and print on the terminal the number of instances of the given string in the file /home/grad/remote_driver.c (d) Reboot the system after 5 minutes. (e) Display the list of processes currently being run by the user harvey. (f) Print 3 copies of a file named my_driver.c from a printer that has a name HPLaserJet4300. (g) Put the last 40 lines of the file driver_log.log into a new file final_fault.txt.