Answer:
The modified program in Python is as follows:
import math
paint_colors = {'red': 35,'blue': 25,'green': 23}
wall_height = int(input('Enter wall height (feet):\n'))
wall_width = int(input('Enter wall width (feet):\n'))
area = wall_height*wall_width
print('Wall area:',area,'square feet')
paint_needed = area/350.0
print('Paint needed: {:.2f} gallons'.format(paint_needed))
print('Cans needed:',round(paint_needed),'can(s)')
color = input("Choose a color to paint the wall: ")
print("Cost of purchasing", color, "paint: $",paint_colors[color])
Explanation:
The italicized are given from the question [unchanged]
import math
paint_colors = {'red': 35,'blue': 25,'green': 23}
wall_height = int(input('Enter wall height (feet):\n'))
This gets input for width
wall_width = int(input('Enter wall width (feet):\n'))
Calculate the wall area
area = wall_height*wall_width
Print the calculated wall area
print('Wall area:',area,'square feet')
Calculate the amount of paint needed
paint_needed = area/350.0
Print the amount of paint needed to 2 decimal places
print('Paint needed: {:.2f} gallons'.format(paint_needed))
Print the amount of can needed to nearest integer
print('Cans needed:',round(paint_needed),'can(s)')
Prompt user for color of paint [here, we assume the user input is correct]
color = input("Choose a color to paint the wall: ")
Prints the corresponding amount for the color
print("Cost of purchasing", color, "paint: $",paint_colors[color])
The following method is intended to return true if and only if the parameter val is a multiple of 4 but is not a multiple of 100 unless it is also a multiple of 400. The method does not always work correctly public boolean isLeapYear(int val) if ((val 4) == 0) return true; else return (val & 400) == 0; Which of the following method calls will return an incorrect response?
A .isLeapYear (1900)
B. isLeapYear (1984)
C. isLeapYear (2000)
D. isLeapYear (2001)
E. isLeapYear (2010)
Answer:
.isLeapYear (1900) will return an incorrect response
Explanation:
Given
The above method
Required
Which method call will give an incorrect response
(a) will return an incorrect response because 1900 is not a leap year.
When a year is divisible by 4, there are further checks to do before such year can be confirmed to be a leap year or not.
Since the method only checks for divisibility of 4, then it will return an incorrect response for years (e.g. 1900) that will pass the first check but will eventually fail further checks.
Hence, (a) answers the question;
In cell B13, create a formula without a function using absolute references that subtracts the values of cells B5 and
B7 from cell B6 and then multiples the result by cell B8. please help with excel!! I'm so lost
Answer:
The formula in Excel is:
=($B$6 - $B$5 - $B$7)* $B$8
Explanation:
Required
Use of absolute reference
To reference a cell using absolute reference, we have to include that $ sign. i.e. cell B5 will be written as: $B$5; B6 as $B$6; B7 as $B$7; and B8 as $B$8;
Having explained that, the formula in cell B13 is:
=($B$6 - $B$5 - $B$7)* $B$8
When computer boots which I pont program starts first? O Operating System O Metaphor System O Basic System O Computer System
A pointer can be used as a function argument, giving the function access to the original argument.
A. True
B. False
Answer:
True
Explanation:
A pointer can be used as a function argument, giving the function access to the original argument.
Which of the following ribbon tools would be most efficient for applying multiple
changes to text formatting?
a. Font Dialog Box
b. Paragraph Styles
c. Styles Dialog Box
d. Find and Replace
Answer:
Option A, Font Dialog Box
Explanation:
In order to make changes in the text formatting, the font setting in the dialog box can be used on the Ribbon's Home tab.
From the font settings in Word 2016, one can change the following change font color, size, style etc.
Hence, option A is correct
NO LINKS
Write a C++ program to accept a 5 digit integer and to validate the input based on the following rules.
Rules
1) The input number is divisible by 2. 2) The sum of the first two digits is less than last two digits. if the input number satisfies all the rules, the system prints valid and invalid, otherwise,
Example 1:
Enter a value: 11222
Output: Input number is valid
Example 2:
Enter a value: 1234
Output: Input number is invalid
Answer:
#include <iostream>
#include <string>
#include <regex>
using namespace std;
int main()
{
cout << "Enter a 5-digit number: ";
string number;
cin >> number;
bool valid = regex_search(number, regex("^\\d{4}[02468]$"));
if (valid) {
valid = stoi(number.substr(0, 1)) + stoi(number.substr(1, 1))
< stoi(number.substr(3, 1)) + stoi(number.substr(4, 1));
}
cout << number << (valid ? " is valid" : " is invalid");
}
Explanation:
Regular expressions can do all of your checking except for the sum of digits check. The checks are i.m.o. easiest if you don't treat the input as a number, but as a string with digits in it.
The regex means:
^ start of string
\d{4} exactly 4 digits
[02468] one of 0, 2, 4, 6 or 8 (this is what makes it even)
$ end of string
As a basic user of SAP Business One, which feature of the application do you like most?
Answer:
I like the software most because it is completely for the sales department. I am very satisfied with what this software provides since I work as a sales specialist.
Explanation:
As an internal auditor, I first have to check and make sure the business is going through all reports and operations and that SAP Business One has helped me a lot with reporting features. I'm a huge fan of SAP Business One. And how this software is incredibly fully integrated when an accountancy provider creates a new customer name or adds a new item in every module, and the non-duplicate data feature secures the master data from any duplicate item.
Intuitive sales quotation and sales order functions help salespeople to develop deals that they can conclude. The mobile app adds to the software's usefulness fantastically.
In general, the system has a good monetary value. I would recommend it to everyone involved in the decision-making process and it is my favorite.
A Key Factor in Controlling Your Anger Is Using Passive behaviour.T/F
Answer:
The answer is "True".
Explanation:
Assertiveness means that others are encouraged to be open, honest about their thoughts, wishes and feelings so how they can act properly. Assertive behavior: be open and communicate wishes, ideas and feelings, as well as encourage others to do likewise. Please visit our Emotional Regulation page. A major aspect is the ability to control your anger. Once you are quiet or aggressive, work very hard.
In the tiger exhibit at the zoo each of 24 tigers eat 26 lb of food each day how much pounds of food do tigers consume in a week?? answer this as fast as you can!!
Answer:
182 pounds of food
Explanation:
A group of computer scientists wants to create a fixed-length compression algorithm. The simplest way to achieve compression is to use a fixed-length code generator. The idea behind this type of code generator is to assign a fixed-length bit sequence to each symbol of the alphabet. As part of this group of computer scientists, your goal is to write a program to determine the alphabet used by the message to be compressed (set of different characters in the input message), and the frequency of each symbol in the alphabet, using conditionals, loops, and arrays.
Answer:
Here the code is given as follows,
Explanation:
OUTPUT:
Message: AAAABBBCCDDDDDDDE
Number of symbols in the alphabet = 5
Characters in the alphabet = A,B,C,D,E
Number of bits per symbol = 3
Histogram showing the frequency of the symbols in the alphabet
A | ****
B | ***
C | **
D | *******
E | *
HEALTH AND SAFETY IN USING ICT TOOLS
Answer:
Health and Safety using ICT Tools.
...
Some of the long-term health effects are:
Headaches and tiredness. Using the mobile phone for hours can be very stressful and may lead to mild or severe headaches.
Creates joint pain. ...
Mobile phone battery explosion. ...
Induced ringing!
Answer:
ICT tools for health and safety. Find common health issues related to computer usage and other ICT tools.
Explanation:
Use of ICT instruments
ICT tools are computer-based equipment used for processing and communicating information and technology. There are certain ICT tools;
- TV.
- System of Public Address
- Radio
- Mobile Phone
- Computer
What are the adverse consequences of long-term television exposure?
You don't have eyes for hours to stare at the TV.
Taking hours on the TV can be dangerous and dangerous for the eye.
If you starve continuously, your eye will get overworked and this will cause an irritation of the eye, such as dry eye, red, itchy, and watery eyes, fatigue, eyelid weight or forehead, as well as eye concentration.
Certain long-term effects on health are:
1. Tiredness and headaches.
2. Make pain joint.
3. Battery explosion mobile phone.
4. Ringing induced! In ears.
calculateAverageSalary(filename): Returns the average salary of all employees rounded down to 2 decimal points highestHireMonth(filename): Returns the month (integer) during which most hires were made over the years getMonth(date): Helper function to extract and return the month number from a date given as a string input of format MM/DD/YY. Return type should be an int.
Answer:
An extract from the answer is as follows:
for i in salary:
total_salary+=float(i)
count+=1
return round(total_salary/count,2)
def getMonth(date):
ddate = []
for i in date:
ddate.append(i.split('/')[0])
mode = int(max(set(ddate), key=ddate.count))
return mode
def highestHireMonth(filename):
month = []
See explanation for further details
Explanation:
Given
Attachment 1 completes the question
The complete answer could not be submitted. So, I've added it as an attachment.
See attachment 2 for program source file which includes the main method.
Comments are used to explain difficult lines
Overview In this assignment, you will gain more practice with designing a program. Specifically, you will create pseudocode for a higher/lower game. This will give you practice designing a more complex program and allow you to see more of the benefits that designing before coding can offer. The higher/lower game will combine different programming constructs that you have been learning about, such as input and output, decision branching, and a loop. IT 140 Higher/Lower Game Sample Output Overview Maria has asked you to create a program that prompts the user to enter the lower bound and the upper hound. You have decided to write pseudocode to design the program before actually developing the code. When run, the program should ask the user to guess a number. If the number guessed is lower than the random number, the program should print out a message like "Nope, too low." if the number guessed is higher than the random number, print out a message like "Nope, too high." If the number guessed is the same as the random number, print out a message like "You got it!" Higher/Lower Game Description Your friend Maria has come to you and said that she has been playing the higher/lower game with her three-year-old daughter Bella. Maria tells Bella that she is thinking of a number between 1 and 10, and then Bella tries to guess the number. When Bella guesses a number, Maria tells her whether the number she is thinking of is higher or lower or if Bella guessed it. The game continues until Bella guesses the right number. As much as Maria likes playing the game with Bella, Bella is very excited to play the game all the time, Maria thought it would be great if you could create a program that allows Bella to play the game as much as she wants. Note: The output messages you include in your pseudocode may differ slightly from these samples. Sample Output Below is one sample output of the program, with the user input demonstrated by bold font. Prompt For this assignment, you will be designing pseudocode for a higher/lower game program. The higher/lower game program uses similar constructs to the game you will design and develop in Projects One and TWO. Welcome to the higher/lower game, Bella! Enter the lower bound: 10 Enter the upper bound: 30 Great, now guess a number between 10 and 30: 20 Nope, too low Guess another number: 25 Nope, too high Guess another number: 23 You got it! Below is another sample output of your program, with the user input demonstrated by bold font 1. Review the Higher/Lower Game Sample Output for more detailed examples of this game. As you read, consider the following questions: What are the different steps needed in this program? How can you break them down in a way that a computer can understand? What information would you need from the user at each point (inputs)? What information would you output to the user at each point? When might it be a good idea to use 'F' and "IF ELSE' statements? When might it be a good idea to use loop? 2. Create pseudocode that logically outlines each step of the game program so that it meets the following functionality: Prompts the user to input the lower bound and upper bound. Include input validation to ensure that the lower bound is less than the upper bound. - Generates a random number between the lower and upper bounds Prompts the user to input a guess between the lower and upper bounds. Include input validation to ensure that the user only enters values between the lower and upper bound. Prints an output statement based on the puessed number. Be sure to account for each of the following situations through the use of decision branching . What should the computer output if the user guesses a number that is too low? . What should the computer output if the user guesses a number that is too high? - What should the computer output if the user guesses the right number? Loops so that the game continues prompting the user for a new number until the user guesses the correct number. Welcome to the higher/lower game, Bella! Enter the lower bound: 10 Enter the upper bound: 5 The lower bound must be less than the upper bound. Enter the lower bound: 10 Enter the upper bound: 20 Great, now guess a number between 10 and 20: 25 Nope, too high Guess another number: 15 Nope, too low. Guess another number: 17 You got it! Sutrnil your completed pseudocode as a Word document of approximately 1 to 2 pages in length.
Answer:
Pseudocode
lower = upper = 0
while lower > upper
input lower
input upper
if lower > upper
print "Lower bound is greater than upper bound"
randNum = generate_a_random_number
print "Guess a number between",lower,"and",upper
input num
while num <> randNum
if num > randNum:
print "Nope, too high"
else:
print "Nope, too low"
input num
print "Great; you got it!"
Program in Python
import random
lower = upper = 0
while True:
lower = int(input("Lower Bound: "))
upper = int(input("Upper Bound: "))
if lower < upper:
break
else:
print("Lower bound is greater than upper bound")
randNum = random.randint(lower, upper)
print("Great; now guess a number between",lower,"and",upper)
num = int(input("Take a guess: "))
while num != randNum:
if num > randNum:
print("Nope, too high")
else:
print("Nope, too low")
num = int(input("Take another guess: "))
print("Great; you got it!")
Explanation:
Required
Write a pseudocode and a program to design a higher/lower game
See answer section for the pseudocode and the program (written in Python)
The pseudocode and the program follow the same pattern; so, I will only explain the program.
See attachment for complete program file where comments are used to explain each line.
(CO 4 and 5) Create a program that will read in a list of test scores from the user and add them to a list. Ask the user in between each score if they want to continue (y/n). Display all of the scores entered and the total score at the end. Using the code below, put the code in the proper order Sample output: Welcome to the Test Score Program Add score: 88.45 Do you want to continue
Answer and Explanation:
Using Javascript:
function AddScores(){
Window.alert("Welcome to the Test Score Program");
var ScoreList= new Array();
ScoreList.push(Prompt("Add Score"));
var WhatNext= Confirm("do you want to continue?");
If(WhatNext===true) {
do{
ScoreList.push(Prompt("Add Score"));
}
While(
Confirm("do you want to continue?")===true;);
}
Alert(ScoreList);
Alert(ScoreList.reduce(function(a,b){return a +b};,0);)
}
AddScores();
From the above code in javascript programming language, we have created a list ScoreList and added elements to it using push method of the array object and a do...while loop that checks the condition and then adds the user's input to the array. We then alerted the array to the screen and then summed up the array elements and also alerted to the screen.
When performing the ipconfig command, what does the following output line depict if found in the tunnel adapter settings?
IPv6 Address: 2001:db8:0:10:0:efe:192.168.0.4
a. IPv6 is disabled.
b. The addresses will use the same subnet mask.
c. The network is not setup to use both IPv4 and IPv6.
d. IPv4 Address 192.168.0.4 is associated with the global IPv6 address 2001:db8:0:10:0:efe
Answer:
d. IPv4 Address 192.168.0.4 is associated with the globe IPv6 address 2001:db8:0:10:0:efe
Explanation:
The adapter setting will be associated with the global IP address. When Ipconfig command is operate the IP address finds the relevant domain and then address will use a different subnet. The network will use both IPv4 and IPv6 subnets in order to execute the command.
In the tunnel adapter settings, when performing the ipconfig command, the given output line depicts: D. IPv4 Address 192.168.0.4 is associated with the global IPv6 address 2001:db8:0:10:0:efe.
What is a tunnel adapter?A tunnel adapter can be defined as a virtual interface which is designed and developed to encapsulate packets as a form of tunnel or virtual private network (VPN) protocol while sending them over another network interface.
In Computer networking, an output line of "IPv6 Address: 2001:db8:0:10:0:efe:192.168.0.4" in the tunnel adapter settings simply means that an IPv4 Address 192.168.0.4 is associated with the global IPv6 address 2001:db8:0:10:0:efe.
Read more on IP address here: https://brainly.com/question/24812743
Any action that causes harm to your computer is called a
1.Security harm
2.Security damage
3.Security risk
4.Security crime
Answer:
Security risk.
Explanation:
It is making your computer vulnerable to attacks and less secure.
Any action that causes harm to your computer is called a security risk. That is option 3.
What is security risk in computer?A computer is an electronic device that can be used to prepare, process and store data.
Security risk in computer is any action undertaken by a computer user that can lead to the loss of data or damage to hardware or software of the computer.
Some of the security risks that predisposes a computer to damage include the following:
unpatched software, misconfigured software or hardware, andbad habits such as keeping fluid close to the computer.Therefore, any action that causes harm to your computer is called a security risk.
Learn more about security risks here:
https://brainly.com/question/25720881
space bar in computer
Answer: Its the one in the middle the really long thingy it looks like a rectangle
Explanation:
ITS IN THE MIDDLE
Design a class named largeIntegers such that an object of this class can store an integer of any number of digits. Add operations to add, subtract, multiply, and compare integers stored in two objects. Also add constructors to properly initialize objects and functions to set, retrieve, and print the values of objects. Write a program to test your class. g
Answer:
Here the code is given as follows,
Explanation:
Code:
import java.util.Scanner;
//created class named largeintegers
class largeintegers{
//class can hold a long number
long number;
//constructor to set number
largeintegers(long number){
this.number=number;
}
//getNumber method to get number
long getNumber(){
return number;
}
//below are some basic operations
long addition(long num1,long num2){
return num1+num2;
}
long subtract(long num1,long num2){
return num1-num2;
}
long multiply(long num1,long num2){
return num1*num2;
}
boolean compare(long num1,long num2)
{
return num1>num2;
}
public static void main(String[] args) {
//declared to long numbers
long number1,number2;
//scanner class to take user input
Scanner sc= new Scanner(System.in);
//taking input numbers
System.out.println("Enter a Number ");
number1=sc.nextLong();
System.out.println("Enter 2nd Number :");
number2=sc.nextLong();
//created two objects
largeintegers object=new largeintegers(number1);
largeintegers object2=new largeintegers(number2);
//displaying two numbers
System.out.println("Entered Numbers ");
System.out.println(object.getNumber());
System.out.println(object2.getNumber());
//calling basic methods using created objects
System.out.println("Some Operations on Given two Numbers ");
System.out.println("Addition:"+object.addition(object.getNumber(), object2.getNumber()));
System.out.println("Subtraction:"+object.subtract(object.getNumber(), object2.getNumber()));
System.out.println("Multiplication:"+object.multiply(object.getNumber(), object2.getNumber()));
System.out.println("Comparison:");
if(object.compare(object.getNumber(), object2.getNumber())==true)
{
System.out.println("First Number is Greater than Second Number ");
}
else
{
System.out.println("Second Number is Greater than First Number ");
}
sc.close();
}
}
Output:-
Smartphones are more likely to be used than laptop computers for everyday ICT use.
Describe three advantages of using a smartphone rather than a laptop computer.
Answer:
it's small amd you can carry it everywhere
easy to use
long lasting battery
Explanation:
hope the answers are right:)
please help me I mark you brilliant thanks
Answer:
B attaches to C, and C goes into A. (Sequence: A, then insert C into A, then insert B into C.)
Explanation:
You can quite literally get the answer from treating it like a puzzle. There is only 1 solution you can have, and they are marked with shapes. This is also the correct solution to clear the text box with button2 on click.
An entertainment application would most likely do which of the following?
A. allow users to watch popular movies and TV shows
B. connect users with social and business contacts
C. confirm users' travel plans
D. teach users a new language
Answer:
A is the answer to this question
Answer:
A. allow users to watch popular movies and TV shows
Explanation:
Create a method called nicknames that passes an array as a parameter. Inside the method initialize it to hold 5 names of your choice. Use the for each enhanced loop to print the elements of the array.
//======METHOD DECLARATION=========//
//method name: nicknames
//method return type: void
//method parameter: an array reference
public static void nicknames(String [] names){
//initialize the array with 5 random names
names = new String[] {"John", "Doe", "Brian", "Loveth", "Chris"};
//using an enhanced for loop, print out the elements in the array
for(String n: names){
System.out.print(n + " ");
}
}
Explanation:
The program is written in Java. It contains comments explaining important parts of the code. Kindly go through these comments.
A few things to note.
i. Since the method does not return any value, its return type is void
ii. The method is made public so that it can be accessible anywhere in and out of the class the uses it.
iii. The method is made static since it will most probably be called in the static main method (at least for testing in this case)
iv. The method receives an array of type String as parameter since the names to be stored are of type String.
v. The format of initializing an array manually should follow as shown on line 7. The new keyword followed by the array type (String), followed by the square brackets ([]) are all important.
vi. An enhanced for loop (lines 9 - 11) is a shorthand way of writing a for loop. The format is as follows;
=> The keyword for
=> followed by an opening parenthesis
=> followed by the type of each of the elements in the array. Type String in this case.
=> followed by a variable name. This holds an element per cycle of the loop.
=> followed by a column
=> followed by the array
=> followed by the closing parenthesis.
=> followed by a pair of curly parentheses serving as a block containing the code to be executed in every cycle of the loop. In this case, the array elements, each held in turn by variable n, will be printed followed by a space.
A complete code and sample output for testing purposes are shown as follows:
==================================================
public class Tester{
//The main method
public static void main(String []args){
String [] names = new String[5];
nicknames(names);
}
//The nicknames method
public static void nicknames(String [] names){
names = new String[] {"John", "Doe", "Brian", "Loveth", "Chris"};
for(String n: names){
System.out.print(n + " ");
}
}
}
==================================================
Output:John Doe Brian Loveth Chris
NB: To run this program, copy the complete code, paste in an IDE or editor and save as Tester.java
Which of the following statements about the relationship between hardware and software is true? a) Hardware can be present in intangible form. b) A flash drive is an example of software. c) Software and hardware can act independently of each other. d) Software consists of instructions that tell the hardware what to do.
Answer:
C
Explanation:
The statements about the relationship between hardware and software that is true is: D. Software consists of instructions that tell the hardware what to do.
A hardware can be defined as the physical components of an information technology (IT) system that can be seen and touched such as:
RouterSwitchKeyboardMonitorMouseConversely, a software refer to a set of executable codes (instructions) that is primarily used to instruct a computer hardware on how it should process data, perform a specific task or solve a particular problem.
In conclusion, a software consist of a set of executable codes (instructions) that tell a computer hardware what to do.
Read more on hardware here: https://brainly.com/question/959479
For each compound below, identify any polar covalent bonds and indicate the direction of the dipole moment using the symbols δ +and δ-.
(a) HBr
(b) HCI
(c) H2O
(d) CH40
Answer:
H-Br bond is polar, hydrogen is partly positive and bromine is partly negative
H-Cl bond is polar, hydrogen is partly positive and bromine is partly negative
O-H bond in water is polar, hydrogen is partly positive and oxygen is partly negative
C-O bond in CH40 is polar, carbon is partly positive and oxygen is partly negative
Explanation:
A molecule possess a dipole moment when there is a large difference in electro negativity between two bonding atoms in the molecule.
The presence of dipole moments introduces polarity to the molecule. In all the molecules listed in the answer, the shared electron pair of the bond is closer to the more electronegative atom causing it to be partially negative while the less electronegative atom in the bond is partially positive.
You're expecting visitors who will be demanding Mamet access Before they arrive, you can activate a Guest network that has its own ________ and a different password from the one used with the network where you store all your files.
functions
is the correct answer of your question ^_^
management is as old as human civilization. justify this statement
Answer:
Indeed, management is as old as the human species, as human nature is itself dependent on the natural resources that it needs for its subsistence, therefore needing to exercise a correct administration of said resources in such a way as to guarantee that those resources can satisfy the greatest number of individuals. That is, the human, through the correct management of resources, seeks to avoid the scarcity of them.
for macroscale distillations, or for microscale distillations using glassware with elastomeric connectors, compare the plot from your simple distillation with that from your fractional distillation. in which case do the changes in temperature occur more gradually
Answer:
Fractional Distillation
Explanation:
Fractional Distillation is more effective as compared to simple distillation. In simple distillation, the temperature changes more gradually as compared to the fractional distillation
Write a test program that prompts the user to enter three sides of the triangle (make sure they define an actual triangle), a color, and a Boolean value to indicate whether the triangle is filled.
Answer:
Scanner in = new Scanner(System.in);
System.out.print("Please enter 3 sides of a triangle, color and " +
"whether it is filled or not (true false): ");
double s1 = in.nextDouble();
double s2 = in.nextDouble();
double s3 = in.nextDouble();
String color = in.next();
boolean filled = in.nextBoolean();
Triangle t1 = null;
try {
t1 = new Triangle(s1, s2, s3, color, filled);
}
catch (IllegalTriangleException ite) {
System.out.println(ite.toString());
}
System.out.println(t1.toString());
System.out.printf("Triangle color: %s, Triangle filled: %s%n" +
"Area: %.2f%n" +
"Perimeter: %.2f%n%n",
t1.getColor(),
t1.isFilled(),
t1.getArea(),
t1.getPerimeter());
Explanation:
Scanner in = new Scanner(System.in);
System.out.print("Please enter 3 sides of a triangle, color and " +
"whether it is filled or not (true false): ");
double s1 = in.nextDouble();
double s2 = in.nextDouble();
double s3 = in.nextDouble();
String color = in.next();
boolean filled = in.nextBoolean();
Triangle t1 = null;
try {
t1 = new Triangle(s1, s2, s3, color, filled);
}
catch (IllegalTriangleException ite) {
System.out.println(ite.toString());
}
System.out.println(t1.toString());
System.out.printf("Triangle color: %s, Triangle filled: %s%n" +
"Area: %.2f%n" +
"Perimeter: %.2f%n%n",
t1.getColor(),
t1.isFilled(),
t1.getArea(),
t1.getPerimeter());
You trained a binary classifier model which gives very high accuracy on thetraining data, but much lower accuracy on validation data. The following maybe true:
a. This is an instance of overfitting.
b. This is an instance of underfitting.
c. The training was not well regularized.
d. The training and testing examples are sampled from different distributions.
Answer:
a. This is an instance of overfitting.
Explanation:
In data modeling and machine learning practice, data modeling begins with model training whereby the training data is used to train and fit a prediction model. When a trained model performs well on training data and has low accuracy on the test data, then we say say the model is overfitting. This means that the model is memorizing rather Than learning and hence, model fits the data too well, hence, making the model unable to perform well on the test or validation set. A model which underfits will fail to perform well on both the training and validation set.
Write a program that will allow a grocery store to keep track of the total number of bottles collected for a seven-day period. The program should allow the user to enter the number of bottles returned for each day of the seven-day period. The program will accumulate the total number of bottles returned for the 7-day period. Then calculate the amount paid out (the total bottles returned times .10 cents). The output (display) of the program should include the total number of bottles returned and the total paid out. Allow the user to enter multiple transactions
Answer:
Print the values days of bottles.Display total number of bottles collecting.Display the payout for this transaction.Explanation:
Program:-
DEPOSIT_PER_BOTTLE = 0.10
another = "Y"
while another=="Y":
print("Input Values 7 days of bottles:")
total = 0
for I in range(7):
collected_bottles = int(input())
total += collected_bottles
payout = total*DEPOSIT_PER_BOTTLE
print("Total number of bottles collected: {:,}".format(total))
print("Payout for this transaction $%.2f"%payout)
another = input("Do you want to complete another transaction? ").upper()