Answer: inner join
Explanation:Edg. 2021
Suppose we wanted to make change for purchases and wanted to use the least number of coins possible. Here is a greedy algorithm: for the change amount due, we always use the largest-face-value coin first. Assume we have only coins of quarters ($.25), twenties ($.20), and pennies ($.01). Assume the change is $.40: a. what would be the coins and their numbers obtained by the greedy algorithm above
Answer:
Explanation:
The following code is a Python function that takes in the amount of change. Then it uses division and the modulo operator to calculate the number of coins that make up the changes, using the greatest coin values first.
import math
def amountOfCoins(change):
print("Change: " + str(change))
quarters = math.floor(change / 0.25)
change = change % 0.25
dimes = math.floor(change / 0.20)
change = change % 0.20
pennies = math.floor(change / 0.01)
print("Quarters: " + str(quarters) + "\nDimes: " + str(dimes) + "\nPennies: " + str(pennies))
In c please
Counting the character occurrences in a file
For this task you are asked to write a program that will open a file called “story.txt
and count the number of occurrences of each letter from the alphabet in this file.
At the end your program will output the following report:
Number of occurrences for the alphabets:
a was used-times.
b was used - times.
c was used - times .... ...and so, on
Assume the file contains only lower-case letters and for simplicity just a single
paragraph. Your program should keep a counter associated with each letter of the
alphabet (26 counters) [Hint: Use array|
| Your program should also print a histogram of characters count by adding
a new function print Histogram (int counters []). This function receives the
counters from the previous task and instead of printing the number of times each
character was used, prints a histogram of the counters. An example histogram for
three letters is shown below) [Hint: Use the extended asci character 254]:
Answer:
#include <stdio.h>
#include <ctype.h>
void printHistogram(int counters[]) {
int largest = 0;
int row,i;
for (i = 0; i < 26; i++) {
if (counters[i] > largest) {
largest = counters[i];
}
}
for (row = largest; row > 0; row--) {
for (i = 0; i < 26; i++) {
if (counters[i] >= row) {
putchar(254);
}
else {
putchar(32);
}
putchar(32);
}
putchar('\n');
}
for (i = 0; i < 26; i++) {
putchar('a' + i);
putchar(32);
}
}
int main() {
int counters[26] = { 0 };
int i;
char c;
FILE* f;
fopen_s(&f, "story.txt", "r");
while (!feof(f)) {
c = tolower(fgetc(f));
if (c >= 'a' && c <= 'z') {
counters[c-'a']++;
}
}
for (i = 0; i < 26; i++) {
printf("%c was used %d times.\n", 'a'+i, counters[i]);
}
printf("\nHere is a histogram:\n");
printHistogram(counters);
}
What is up with the bots? They are so annoying.
Answer:
very very very annoying
Answer:
yeah
Explanation:
Which of the following is NOT an example of a metasearch engine?
Answer:
Where is the choices mate?
Write an algorithm and flowchart to display H.C.F and L.C.M of given to numbers.
Answer:
Write an algorithm to input a natural number, n, and calculate the odd numbers equal or less than n. ... Design an algorithm and flowchart to input fifty numbers and calculate their sum. Algorithm: Step1: Start Step2: Initialize the count variable to zero Step3: Initialize the sum variable to zero Step4: Read a number say x Step 5: Add 1 to the number in the count variable Step6: Add the ..
Explanation:
How do u and justify a document
Who first demonstrated the computer mouse?
O Microsoft
O Alan Turing
O Douglas Engelbart
O Apple, Inc.
FAST PLEASEEE THANK YOUUU
Answer:
C. Douglas Engelbart
Explanation:
Answer: C
Explanation:
Color, font, and images are all important aspects of good
I'll mark brainest
Answer:
of good design, so its c ....
Answer: Design
Color, font, and images are all important aspects of good Design.
, Hope this helps :)
Have a great day!!
Using a text editor, create a file that contains a list of at least 15 six-digit account numbers. Read in each account number and display whether it is valid. An account number is valid only if the last digit is equal to the remainder when the sum of the first five digits is divided by 10. For example, the number 223355 is valid because the sum of the first five digits is 15, the remainder when 15 is divided by 10 is 5, and the last digit is 5. Write only valid account numbers to an output file, each on its own line. Save the application as ValidateCheckDigits.java.
Answer:
Explanation:
The following code is written in Java. It reads every input and checks to see if it is valid. If it is it writes it to the output file.
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Scanner;
class Brainly {
public static void main(String[] args) {
try {
File myObj = new File("C:/Users/Gabriel2/AppData/Roaming/JetBrains/IdeaIC2020.2/scratches/input.txt");
Scanner myReader = new Scanner(myObj);
FileWriter myWriter = new FileWriter("C:/Users/Gabriel2/AppData/Roaming/JetBrains/IdeaIC2020.2/scratches/output.txt");
while (myReader.hasNextLine()) {
String data = myReader.nextLine();
int sum = 0;
for (int x = 0; x < 5; x++ ) {
sum += data.charAt(x);
}
int remainder = (sum % 10);
System.out.println(remainder);
System.out.println(data.charAt(5));
if (remainder == Integer.parseInt(String.valueOf(data.charAt(5)))) {
System.out.println("entered");
try {
myWriter.write(data + "\n");
System.out.println("Successfully wrote to the file.");
} catch (IOException e) {
System.out.println("An error occurred.");
e.printStackTrace();
}
}
sum = 0;
}
myWriter.close();
myReader.close();
} catch (FileNotFoundException e) {
System.out.println("An error occurred.");
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
Write a function input_poly(ptr1) that reads in two polynomials at a time with coefficient and exponent from a file cp7_in.txt. The file will contain 2n polynomials, where n is an integer that is 10 or less. Space for the polynomial will be allocated in run time and there is no limit to the size of the polynomial, e..g the first two lines of the file is
Answer:
try this
Explanation:
#include<stdio.h>
#include<malloc.h>
typedef struct poly{ double coff;
int pow;
struct poly *link; }SL;
void create(SL **head)
{
*head=NULL;
}
//Insertion
void ins_beg(SL ** head, double c, int pw)
{
SL *ptr;
ptr=(SL *)malloc(sizeof(SL));
ptr->coff=c;
ptr->pow=pw;
ptr->link=*head;
*head=ptr;
}
void trav(SL **head)
{
SL *ptr;
ptr=*head;
printf("\n\t Cofficient Exponent\n");
while(ptr!=NULL)
{ printf("\t\t%3.2f \t%d\n",ptr->coff, ptr->pow);
ptr=ptr->link;
}
}
//addition of polynomial............
void mult(SL *pl1, SL *pl2, SL **res)
{
SL trav1, trav2, ptr, new1,*loc;
int x,y;
trav1=*pl1;
while(trav1!=NULL)
{
trav2=*pl2;
while(trav2!=NULL)
{
x=(trav1->coff)*(trav2->coff);
y=(trav1->pow)+(trav2->pow);
//printf("\t%d\t%d\n",x,y);
if(*res==NULL)
{
new1=(SL *)malloc(sizeof(SL));
new1->coff=x;
new1->pow=y;
new1->link=NULL;
*res=new1;
}
else
{
ptr=*res;
while((y<ptr->pow)&&(ptr->link!=NULL))
{
loc=ptr;
ptr=ptr->link;
}
if(y==ptr->pow)
ptr->coff=ptr->coff+x;
else
{
if(ptr->link!=NULL)
{
new1=(SL *)malloc(sizeof(SL));
new1->coff=x;
new1->pow=y;
loc->link=new1;
new1->link=ptr;
}
else
{
new1=(SL *)malloc(sizeof(SL));
new1->coff=x;
new1->pow=y;
ptr->link=new1;
new1->link=NULL;
}
}
}
trav2=trav2->link;
}
trav1=trav1->link;
}
}
//...addition..............
void add(SL *pl1, SL *pl2)
{
SL trav1, ptr, *new1,*loc; trav1=*pl1;
while(trav1!=NULL)
{
loc=ptr=*pl2;
while((trav1->pow<ptr->pow)&&(ptr->link!=NULL))
{
loc=ptr; ptr=ptr->link;
}
if(loc==ptr)
{
new1=(SL *)malloc(sizeof(SL));
new1->coff=trav1->coff;
new1->pow=trav1->pow;
new1->link=*pl2;
*pl2=new1;
}
else
if(trav1->pow==ptr->pow)
{
ptr->coff=ptr->coff+trav1->coff;
//ptr->pow=ptr->pow+trav1->pow;
}
else
if(ptr->link!=NULL)
{
new1=(SL *)malloc(sizeof(SL));
new1->coff=trav1->coff;
new1->pow=trav1->pow;
new1->link=ptr;
loc->link=new1;
}
else
{
new1=(SL *)malloc(sizeof(SL));
new1->coff=trav1->coff;
new1->pow=trav1->pow;
new1->link=NULL;
ptr->link=new1;
}
trav1=trav1->link;
}
}
int main()
{
SL first, sec, *res;
create(&first);
ins_beg(&first,10.25,0);
ins_beg(&first,4,1);
ins_beg(&first,5,2);
ins_beg(&first,4,4);
printf("\nFirst Polinomial:\n");
trav(&first);
create(&sec);
ins_beg(&sec,11,0);
ins_beg(&sec,6,1);
ins_beg(&sec,4,2);
ins_beg(&sec,3,3);
printf("\nSecond Polinomial:\n");
trav(&sec);
create(&res);
printf("\nMultiplication of two Polinomial:\n");
mult(&first,&sec,&res);
trav(&res);
printf("\nAddition of two Polinomial:\n");
add(&first,&sec);
trav(&sec);
//trav(&first);
return 0;
}
Plz hurry it’s timed
What are 3 data Gathering method that you find effective in creating interactive design for product interface and justify your answer?
Answer:
In other words, you conducted the four fundamental activities that make up the interaction design process – establishing requirements, designing alternatives, prototyping designs, and evaluating prototypes.
Explanation:
Working with do-while loop
Bring the program dowhile.cpp from the Lab 5 folder.
The code is shown below:
______________________________________________________________________________
// This program displays a hot beverage menu and prompts the user to
// make a selection. A switch statement determines which item the user
// has chosen. A do-while loop repeats until the user selects item E
// from the menu.
// PLACE YOUR NAME HERE
#include
#include
using namespace std;
int main()
{
// Fill in the code to define an integer variable called number,
// a floating point variable called cost,
// and a character variable called beverage
bool validBeverage;
cout << fixed << showpoint << setprecision(2);
do
{
cout << endl << endl;
cout << "Hot Beverage Menu" << endl << endl;
cout << "A: Coffee $1.00" << endl;
cout << "B: Tea $ .75" << endl;
cout << "C: Hot Chocolate $1.25" << endl;
cout << "D: Cappuccino $2.50" << endl <
cout << "Enter the beverage A,B,C, or D you desire" << endl;
cout << "Enter E to exit the program" << endl << endl;
// Fill in the code to read in beverage
switch(beverage)
{
case 'a':
case 'A':
case 'b':
case 'B':
case 'c':
case 'C':
case 'd':
case 'D': validBeverage = true;
break;
default: validBeverage = false;
}
if (validBeverage == true)
{
cout << "How many cups would you like?" << endl;
// Fill in the code to read in number
}
// Fill in the code to begin a switch statement
// that is controlled by beverage
{
case 'a':
case 'A': cost = number * 1.0;
cout << "The total cost is $ " << cost << endl;
break;
// Fill in the code to give the case for tea ( $0.75 a cup)
//Fill in the code to give the case for hot chocolate($1.25 a cup)
// Fill in the code to give the case for cappuccino ($2.50 a cup)
case 'e':
case 'E': cout << " Please come again" << endl;
break;
default:cout << // Fill in the code to write a message
// indicating an invalid selection.
cout << " Try again please" << endl;
}
} // Fill in the code to finish the do-while statement with the
// condition that beverage does not equal (E or e).
// Fill in the appropriate return statement
}
Answer:
it throws an error with the includes.
and some undeclared variables.
Explanation:
please fix that.
What characteristics should be determined to design a relational database? Check all that apply.
the fields needed
the tables needed
the keys and relationships
the purpose of the database
all of the tables in the database
all of the records in the database
the queries, forms, and reports to generate
Answer: 1,2,3,4,7
Just took it (:
what is the Is option that prints to the author of a file?
Answer:
We need to use Option - 'author' along with option- 'l'when the tv was created (year)
Answer:
1927
Explanation:
Answer:
1971 is the year
(01)²
what is 2 in this number
Answer and Explanation:
It's an exponent (2 is squared I believe)
When you have an exponent, multiply the big number by the exponent
Ex: [tex]10^2[/tex]= 10x2=20
Ex: [tex]10^3\\[/tex]= 10x3=30
NO LINKS OR SPAMS THEY WILL BE REPORTD
Click here for 50 points
Answer:
thanks for the point and have a great day
Create a game that rolls two dies (number from 1 to 6 on the side) sequentially for 10 times (use loop). If at least once out of 10 times the sum of two random numbers is equal to 10, you win, else you loose. You will need to get your own method getRandom(int n) that generates a random number, see below (you can modify it as needed), a loop, and IF statement in the loop that checks if a sum of two random numbers is 10 or not.
Please start your program as follows, similar to what we did in class:
import java.util.Random;
public class UseRandom{
//your method getRandom() is here below, n is a range for a random number from 0 to n
public int getRandom(int n)
{
Random r=new Random();
int rand=r.nextInt(n);
return rand;
}
//code continues here, don't forget your main() method inside the class, and making your own object in main() using "new" keyword.
Answer:
Explanation:
The following code is written in Java and loops through 10 times. Each time generating 2 random dice rolls. If the sum is 10 it breaks the loop and outputs a "You Win" statement. Otherwise, it outputs "You Lose"
import java.util.Random;
class Brainly {
public static void main(String[] args) {
UseRandom useRandom = new UseRandom();
boolean youWin = false;
for (int x = 0; x<10; x++) {
int num1 = useRandom.getRandom(6);
int num2 = useRandom.getRandom(6);
if ((num1 + num2) == 10) {
System.out.println("Number 1: " + num1);
System.out.println("Number 2: " + num2);
System.out.println("You Win");
youWin = true;
break;
}
}
if (youWin == false) {
System.out.println("You Lose");
}
}
}
class UseRandom{
public int getRandom(int n)
{
Random r=new Random();
int rand=r.nextInt(n);
return rand;
}}
Why do Apple phones die quickly
Answer:
anything
Explanation:
A lot of things can cause your battery to drain quickly. If you have your screen brightness turned up, for example, or if you're out of range of Wi-Fi or cellular, your battery might drain quicker than normal. It might even die fast if your battery health has deteriorated over time.
In class we created an opaque object for a type called MY_VECTOR that had an internal structure called My_vector consisting of an integer size, an integer capacity, and an integer pointer data that held the address of the first element of a dynamic array of integers. Write a function called copyVECTOR that receives an opaque object (of type MY_VECTOR) and returns the address of an exact copy of the passed opaque object upon success and NULL otherwise.
Java 2D Drawing Application. The application will contain the following elements:
a) an Undo button to undo the last shape drawn.
b) a Clear button to clear all shapes from the drawing.
c) a combo box for selecting the shape to draw, a line, oval, or rectangle.
d) a checkbox which specifies if the shape should be filled or unfilled.
e) a checkbox to specify whether to paint using a gradient.
f) two JButtons that each show a JColorChooser dialog to allow the user to choose the first and second color in the gradient.
g) a text field for entering the Stroke width.
h) a text field for entering the Stroke dash length.
I) a checkbox for specifying whether to draw a dashed or solid line.
j) a JPanel on which the shapes are drawn.
k) a status bar JLabel at the bottom of the frame that displays the current location of the mouse on the draw panel.
If the user selects to draw with a gradient, set the Paint on the shape to be a gradient of the two colors chosen by the user. If the user does not chosen to draw with a gradient, the Paint with a solid color of the 1st Color.
Note: When dragging the mouse to create a new shape, the shape should be drawn as the mouse is dragged.
Answer:
sadness and depression is my answer
Explanation:
Operating Expenses for a business includes such things as rent, salaries, and employee benefits.
Answer:
TRUE
Explanation:
What is the problem with paying only your minimum credit card balance each month?
A. It lowers your credit score
B. You have to pay interest
C. The bank will cancel your credit card
D. All of the above
Answer:b
Explanation:
Answer: The answer is B.
Explanation: While yes it is important to make at least the minimum payment, its not ideal to carry a balance from month to month (You'll rack up interest charges). And risk falling into debt. Therefore, the answer is B.
Hope this helps!
ghggggggggggggghbbbbbjhhhhhhhh
Answer:
Something wrong?
Explanation:
Write a Java program named Problem 3 that prompts the user to enter two integers, a start value and end value ( you may assume that the start value is less than the end value). As output, the program is to display the odd values from the start value to the end value. For example, if the user enters 2 and 14, the output would be 3, 5, 7, 9, 11, 13 and if the user enters 14 and 3, the output would be 3, 5, 7, 9, 11, 13.
Answer:
hope this helps
Explanation:
import java.util.Scanner;
public class Problem3 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.print("Enter start value: ");
int start = in.nextInt();
System.out.print("Enter end value: ");
int end = in.nextInt();
if (start > end) {
int temp = start;
start = end;
end = temp;
}
for (int i = start; i <= end; i++) {
if (i % 2 == 1) {
System.out.print(i);
if (i == end || i + 1 == end) {
System.out.println();
} else {
System.out.print(", ");
}
}
}
}
}
The given SQL creates a song table and inserts three songs.
Write three UPDATE statements to make the following changes:
Change the title from 'One' to 'With Or Without You'.
Change the artist from 'The Righteous Brothers' to 'Aritha Franklin'.
Change the release years of all songs after 1990 to 2021.
Run your solution and verify the songs in the result table reflect the changes above.
CREATE TABLE song (
song_id INT,
title VARCHAR(60),
artist VARCHAR(60),
release_year INT,
PRIMARY KEY (song_id)
);
INSERT INTO song VALUES
(100, 'Blinding Lights', 'The Weeknd', 2019),
(200, 'One', 'U2', 1991),
(300, 'You\'ve Lost That Lovin\' Feeling', 'The Righteous Brothers', 1964),
(400, 'Johnny B. Goode', 'Chuck Berry', 1958);
-- Write your UPDATE statements here:
SELECT *
FROM song;
Answer:
UPDATE song SET title = 'With Or Without You' WHERE song_ID = 200UPDATE song SET artist = 'Aritha Franklin' WHERE song_ID = 300UPDATE song SET release_year = 2021 WHERE release_year > 1990Explanation:
Given
The above table definition
Required
Statement to update the table
The syntax of an update statement is:
UPDATE table-name SET column-name = 'value' WHERE column-name = 'value'
Using the above syntax, the right statements is as follows:
UPDATE song SET title = 'With Or Without You' WHERE song_ID = 200The above sets the title to 'With Or Without You' where song id is 200
UPDATE song SET artist = 'Aritha Franklin' WHERE song_ID = 300
The above sets the artist to 'Aritha' where song id is 300
UPDATE song SET release_year = 2021 WHERE release_year > 1990The above sets the release year to '2021' for all release year greater than 1990
In this lab, you complete a partially prewritten Python program that uses a list.
The program prompts the user to interactively enter eight batting averages, which the program stores in an array. It should then find the minimum and maximum batting averages stored in the array, as well as the average of the eight batting averages. The data file provided for this lab includes the input statement and some variable declarations. Comments are included in the file to help you write the remainder of the program.
Instructions
Make sure the file BattingAverage.py is selected and open.
Write the Python statements as indicated by the comments.
Execute the program by clicking the "Run Code" button at the bottom of the screen. Enter the following batting averages: .299, .157, .242, .203, .198, .333, .270, .190. The minimum batting average should be .157 and the maximum batting average should be .333. The average should be .2365.
Grading
When you have completed your program, click the "Grade" button to record your score.
Lists
BattingAverage.py
4
43
Unix Terminal>
1 # Declare a named constant for array size here.
2 MAX_AVERAGES = 8
3?
4 # Declare array here.
5 averages = []
6 ?
7 # Write a loop to get batting averages from user and assign to array.
8 for i in range(MAX_AVERAGES):
9 averageString = input("Enter a batting average: ")
10 battingAverage = float(averageString)
11 # Assign value to array.
12 averages.append(battingAverage)
13 ?
14 # Assign the first element in the array to be the minimum and the maximum.
15 minAverage = averages[0]
16 maxAverage = averages[0]
17 # Start out your total with the value of the first element in the array.
18 total = averages[0]
19 # Write a loop here to access array values starting with averages[1]
20 ?
21 # Within the loop test for minimum and maximum batting averages.
22 for i in range(1, MAX_AVERAGES):
23 f averages[i] < minAverage:
24 minAverage = averages[i]
25 if averages[i] > maxAverage:
26 maxAverage = averages[i]
27 total += averages[i]
28 ?
29 # Also accumulate a total of all batting averages.
30 ?
31 ?
32 # Calculate the average of the 8 batting averages.
33 average = total / MAX_AVERAGES
34 ?
35 # Print the batting averages stored in the averages array.
36 for avg in averages:
37 print(avg)
38 ?
39 # Print the maximum batting average, minimum batting average, and average batting average.
40 print('Maximum batting average is ' + str(maxAverage))
41 print('Minimum batting average is ' + str(minAverage))
42 print('Average batting average is ' + str(average))
43 ?
W
Run Code
Ctrl + Enter
TestGrade
Answer:
See Explanation
Explanation:
Required
Complete the given code
First, it should be noted that the original code (in the question) is complete, however it is poorly formatted.
The errors that may arise when the code is run is as a result of the poor format of the code.
I've corrected all errors and I fixed the indentations in the original code.
See attachment for the complete code.
Q. Describe the T.V. as an ICT tool.
Answer:
TV or modern televisions are also a type of ICT tool because we get a wide amount of information about mass communication through the various news channels on the TV. TV is now also the most popular as well as a cheap medium of mass communication.
How I did it. Part 4
Answer:
What are you asking for in this problem?
Explanation: