6.6 code practice question 2? 4 adjacent circles one

Answers

Answer 1

We have to create a program that draws an image of concentric circles with the help of canvas  and frame using python.

Codding strucute of the given problem:

import simplegui

def draw_handler(canvas):

  canvas.draw_circle((200, 130), 90, 5, "Green")

  canvas.draw_circle((200, 130), 70, 5, "Green")

  canvas.draw_circle((200, 130), 50, 5, "Green")

  canvas.draw_circle((200, 130), 30, 5, "Green")

  canvas.draw_circle((200, 130), 10, 5, "Green")

frame = simplegui.create_frame('Circle', 600, 600)

frame.set_canvas_background("White")

frame.set_draw_handler(draw_handler)

frame.start()

To know more about Python, visit: https://brainly.com/question/26497128

#SPJ1


Related Questions

Tech A says that it is usually better to pull a wrench to tighten or loosen a bolt. Tech B says that
pushing a wrench will protect your knuckles if the wrench slips. Who is correct?

Answers

Tech A is correct because pulling a wrench to tighten or loosen a bolt secures it to the bolt threading, reducing the possibility of it slipping.

How to tighten nuts and bolts?

Place your socket on the wrench's head. To begin using your torque wrench, insert a socket that fits your nut or bolt into the torque wrench's head. If you have an extender or adaptor, you can insert it into the opening at the head instead.

Hand-tighten the nut or bolt until it catches the threading on the screw. Place the nut or bolt to be tightened over the threading for the screw or opening on your vehicle by hand. Turn the nut or bolt on the vehicle clockwise with your fingers until the threading on the screw catches. Turn the nut or bolt until it can no longer be turned by hand.

Place the wrench on top of the nut or bolt being tightened. Hold the torque wrench handle in your nondominant hand while the nut or bolt is set on the threading.

Tighten the nut or bolt by turning the handle clockwise. When the wrench starts clicking or stops moving, stop turning it.

To know more about wrench and bolts, kindly visit: https://brainly.com/question/15075481

#SPJ1

How is trust built?
Select all the correct options and click Submit.
Trust is built incrementally.
Trust is earned behaviorally.
Trust is built by spending a lot of time with people.
Trust is built by being pleasant and polite.

Answers

The trust is built by the following options:

Trust is built incrementally.Trust is earned behaviorally.Trust is built by spending a lot of time with people.

How trust is built?

Trust is built by spending much time with the people you are in contact with you have to observe the behavioral characteristics and notice the behavior accordingly. Most important characteristics to build trust: Honesty, Integrity, Transparency etc. Hence to conclude along with certain observance and characteristics trust is built. Consistency often leads to trust. We have the most faith in people who are always there for us, in good and bad times. Showing someone you're there to assist them on a regular basis is a great way to build trust.

To know more about trust please follow the link below:

https://brainly.com/question/11875869

#SPJ1

least privilege meaning in cybersecurity

Answers

Answer:

It is where each system is designed so that it only has the permissions necessary to operate, nothing more.

Explanation:

This is done for security concerns, which is the whole reason for cybersecurity.

which country did poker originate from?

Answers

Poque, a game that dates back to 1441 and that was supposedly invented in Strasbourg, seems to be the first early evidence of the French origin of the game. Poque in particular used a 52-card deck

France/French

Write a function so that the main() code below can be replaced by the simpler code that calls function MphAndMinutes ToMiles().
Original main):
int main()
double milesPerHour;
double minutesTraveled;
double hoursTraveled;
double milesTraveled;
cin >> milesPerHour;
cin >> minutesTraveled;
hoursTraveled minutesTraveled / 60.0;
milesTraveled - hoursTraveled * milesPerHour;
cout ‹< "Miles:
<< milesTraveled ‹‹ endl;
return 0;

Answers

#include <iostream>

double mph_and_minutes_to_miles(double mph, double min) {

   return mph*double(min/60);

}

int main(int argc, char* argv[]) {

   double imph, imin; std::cin>>imph>>imin;

   std::cout << "Miles: " << mph_and_minutes_to_miles(imph,imin) << std::endl;

   return 0;

}

Implication if the intellectual property rights do not exist

Answers

Intellectual Property Rights (IPR) are  the creative rights over an original piece of work, invention or even an idea behind a business can come under the purview of Intellectual Property Rights Act.

Implication if the intellectual property rights do not exist

1.  Less research and development as nobody would reap benefits generated by their innovations.

2. Cultural and art vitality as they would not be made more according to their original work.

3. Job losses and economic issues as IPR helps in boosting both of these factors.

4. Healthcare and treatment would be at lost because of less innovation of useful vaccines.

5. Less emergence of startups with unique ideas, decline in innovative trade and a race backwards.

6. Counterfeiting of journals, research papers leading to a still situation.

Hence, these factors explain what would happen without IPR.

To know more about Intellectual property rights from the given link

https://brainly.com/question/24015145

#SPJ13

What percent of 2.5 hours decrease to 1 hour

Answers

Answer: 60% decrease

Explanation:

How to calculate percentage decrease:

Subtract starting value minus final value

Divide that amount by the absolute value of the starting value

Multiply by 100 to get percent decrease

If the percentage is negative, it means there was an increase and not an decrease.

Percentage Decrease Formula

You can use the percentage decrease formula for any percent decrease calculation:

Percentage Decrease=Starting Value−Final Value|Starting Value|×100

Example Problem: Percentage Decrease

You have a lamp with a 60-watt traditional light bulb. Your lamp uses 60 watts of electricity per hour. You're considering replacing the bulb with an LED light bulb that uses 8 watts of electricity per hour. What is the percentage decrease in the lamp's hourly energy use if you switch to an LED light bulb?

Percentage Decrease = [ (Starting Value - Final Value) / |Starting Value| ] × 100

60 - 8 = 52

52 / 60 = 0.8667

0.8667 × 100 = 86.67%

So if you switch to an LED light bulb your lamp will use 86.67% less energy per hour.

Related Calculators

Answer:

40%

Explanation:

Whenever we find "x" percent of a number, we simply multiply by "x/100", because "percent" just means "per 100".

We can divide the 2.5, by 100 to see how many "groups" of 100 are in 2.5, which gets us, 0.025.

Now we multiply this by some value, which will be our percent, to get "1"

So we have the equation: [tex]0.025 * x = 1[/tex]

Dividing both sides by 0.025 gives us: [tex]x=40[/tex]

so our percentage would be 40.

But generally whenever you solve these problems you convert the "percentage" to a "decimal" by dividing the percentage by 100.

So finding "x" percent of "a", can be calculated by: [tex]a*\frac{x}{100}[/tex]

and from here you would calculate the value with the givens.

model sees communication occurring in five key parts
19. The
20
means the systematic application of scientific or other organized knowledge to practical task
21. The model that shows our communication is influenced by environmental, cultural and personal
factors
22. Shannon Weaver model was proposed in the year
23. Fourth generation computers used
24. Auto Gasoline pump is an example of a
25.
26.
27.
28.
29.
30. A server may run several
31. The first mechanical computer designed by Charles Babbage uses,
32.
33. The first generation of computer uses
34
computer
computer are mainly used in the fields of science and engineering
provides us with necessary diversion
available for educational purposes other than the teacher
are the means of communication
is when two persons communicate with each other.
controls educational technology in every way.
is the order in which the content should be taught for the best teaming within a grade?
is a distortion in a message which affects the flow of communication
refers to the facilities used for motion pictures, television, computer, sounds?
35.
36. Aristotle model proposed in the year
37. The first computer designed by Charles Babbage was called
38. Communication result in sharing of
and
39. A Supercomputer is the very
40.
41. A typical modern computer uses
42
and
is the operation of data per giving instruction
type of computer for processing data
chips
computer are used in scientific calculations, for nation defense and radar systems
43. The person who is responsible in the integration of technology in classroom instruction is-
44. A server run several
45. These are types in the classifications of the computer according to size, Except
46 Second generation computers used.
47.
48. The acronomy SNS stands for
is used to send individual or group messages
49. These are example of Barriers in communication, Except
50. Computer cannot do anything without a
PRI

Answers

Model sees comunication key parts so its 15 x because it sayd on the text

Consider a 3x4 rectangular shape room. Four computers are located at the four
corners of the room. The HUB is placed on the center of the room. Calculate the
minimum length of cables required to connect the computers in a network in each of the
following topologies:
a) Bus topology
b) Ring topology
c) Star topology
d) Mesh topology

Answers

The minimum length of cables required to connect the computers in a network in each of the bus topology. Thus, option (a) is correct.

What is computers?

Computer is the name for the electrical device. In 1822, Charles Babbage created the first computer. The work of input, processing, and output was completed by the computer. Hardware and software both run on a computer. The information is input into the computer, which subsequently generates results.

According to givens the scenario was the justify are the 3×4 rectangular shape room there are the four computers are the set-up to the HUB is placed in the center of the room. The bus topology is the based on the networks are the subsequently.

As a result, the minimum length of cables required to connect the computers in a network in each of the bus topology. Therefore, option (a) is correct.

Learn more about on computers, here:

https://brainly.com/question/21080395

#SPJ2

Write a java program to find the average of any three numbers.​

Answers

import java.util.Scanner;

public class JavaExample {

public static void main(String[] args)

{

Scanner scan = new Scanner(System.in);

System.out.print("Enter the first number: ");

double num1 = scan.nextDouble();

System.out.print("Enter the second number: ");

double num2 = scan.nextDouble();

System.out.print("Enter the third number: ");

double num3 = scan.nextDouble();

scan.close();

System.out.print("The average of entered numbers is:" + avr(num1, num2, num3) );

}

public static double avr(double a, double b, double c)

{

return (a + b + c) / 3;

}

}

The output is attached to the answer. You can also check it..

common errors in writing Python

Answers

Answer:

1.not following the rules

2.misusing expression

Write an SQL statement to display for every restaurant the name of the restaurant (where the name of the restaurant consists of more than 10 characters) and for every category of menu item its description (catdesc). Furthermore, display the average; cheapest or lowest; and highest or most expensive price of all menu items in that category at that restaurant. Use single row functions to format all the prices. The average price must be padded; the cheapest price must be rounded; but the highest price must not be rounded. Display only those menu items of which the average item price is more than R40. Sort your results according to the restaurant names and for every restaurant from the most expensive average menu item to the cheapest average menu item. Display your results exactly as listed below.

Answers

Using the knowledge in computational language in SQL it is possible to write the code that display for every restaurant the name of the restaurant  and for every category of menu item its description.

Writting the code:

INSERT INTO Dish Values(13, 'Spring Rolls', 'ap');

INSERT INTO Dish Values(15, 'Pad Thai', 'en');

INSERT INTO Dish Values(16, 'Pot Stickers', 'ap');    

INSERT INTO Dish Values(22, 'Masaman Curry', 'en');  

INSERT INTO Dish Values(10, 'Custard', 'ds');  

INSERT INTO Dish Values(12, 'Garlic Bread', 'ap');    

INSERT INTO Dish Values(44, 'Salad', 'ap');    

INSERT INTO Dish Values(07, 'Cheese Pizza', 'en');  

INSERT INTO Dish Values(19, 'Pepperoni Pizza', 'en');    

INSERT INTO Dish Values(77, 'Veggie Supreme Pizza', 'en');

INSERT INTO MenuItem Values(0, 0, 13, 8.00);

INSERT INTO MenuItem Values(1, 0, 16, 9.00);

INSERT INTO MenuItem Values(2, 0, 44, 10.00);

INSERT INTO MenuItem Values(3, 0, 15, 19.00);

INSERT INTO MenuItem Values(4, 0, 22, 19.00);

INSERT INTO MenuItem Values(5, 3, 44, 6.25);

INSERT INTO MenuItem Values(6, 3, 12, 5.50);

INSERT INTO MenuItem Values(7, 3, 07, 12.50);

INSERT INTO MenuItem Values(8, 3, 19, 13.50);

INSERT INTO MenuItem Values(9, 5, 13, 6.00);

INSERT INTO MenuItem Values(10, 5, 15, 15.00);

INSERT INTO MenuItem Values(11, 5, 22, 14.00);

See more about SQL atbrainly.com/question/13068613

#SPJ1

when computer and communications are combined, the result is information and cominiations Technology (true or false)​

Answers

Answer: When computer and communication technologies are combined the result is Information technology.

Explanation: This is a technology that combines computation with high-speed data, sound, and video transmission lines. All computer-based information systems utilized by companies, as well as their underlying technologies, are referred to as information technology.

As a result, information technology encompasses hardware, software, databases, networks, and other electronic gadgets.

IT refers to the technological component of information systems, making it a subsystem of information systems.

Information systems, users, and administration would all be included in a broader definition of IT.

Many organizations rely on IT to support their operations, since IT has evolved into the world's primary facilitator of project activities. IT is sometimes utilized as a catalyst for fundamental changes in an organization's structure, operations, and management. This is because of the capabilities it provides for achieving corporate goals.

These competences help to achieve the following five business goals:

Increasing productivity,

lowering expenses,

improving decision-making,

improving customer interactions, and

creating new strategic applications.

Python programming using def function

Give the user a math quiz where they have
to subtract 2-digit integers. Present them
like this: 67 - 55.
Each time, tell the user whether they are
correct or incorrect. Continue presenting
problems to them until they enter a zero to
quit. At the end print the number right,
the number wrong, and the percent right.

Answers

Explanation:

For this program we'll need to know a couple concepts which are: while loops, user input, variables, converting strings to integers, and basic arithmetic operators, if statements, and the random module.

So let's first just declare the basic function, we can call this "main", or something a bit more descriptive, but for now I'll name it "main".

def main():

   # code will go here

main()

so now from here, we want to initialize some variables. We need to somehow keep track of how many they get correct and how many they've answered.

These two numbers may be the same, but at times they will be different from each other, so we'll need two variables. Let's just call the variable tracking how much have been answered as "answered" and the variable tracking how much are correct as "correct".

These two will initially be zero, since the user hasn't answered any questions or gotten any correct. So now we have the following code

def main():

   correct = 0

   answered  = 0

main()

Now let's use a while loop, which we break out of, once the user inputs zero. This may be a bit tricky if we use a condition since we'll have to ask for input before, so let's just use a while True loop, and then use an if statement to break out of it at the end of the loop.

Now we want to generate two numbers so we can use the random module. To access the functions from the random module you use the import statement which will look like this "import random". Now that you have access to these functions, we can use the randint function which generates random numbers between the two parameters you give it (including those end points). It says two digits, so let's use the endpoints 10 and 98, and I'll explain later why I'm limiting it to 98 and not 99.

The reason we want to limit it to 98 and not 99, is because it's possible for the two randomly generated numbers to be equal to each other, so the answer would be zero. This is a problem because the zero is used to quit the program. So what we can do in this case, is add one to one of the numbers, so they're no longer equal, but if they're equal to 99, then now we have a three digit number.

Now onto the user input for simplicitly, let's assume they enter valid input, all we have to do is store that input in a variable and convert it into an integer. We can immediately convert the input into an integer by surrounding the input by the int to convert it.

we of course want to display them the equation, and we can either do this through string concatenation or f-strings, but f-strings are a bit more easier to read.

So let's code this up:

import random

def main():

   correct = 0

   answered  = 0

   while True:

       num1 = random.randint(10, 98)

       num2 = random.randint(10, 98)

       

       if num1 == num2:
           num2 += 1

       userInput = int(input(f"{num1} - {num2}"))

main()

from here we first need to check if they entered zero and if so, break out of the loop. If they didn't enter zero, check if the userInput is equal to the actual answer and if it is, then add one to correct and finally add one to answered regardless of whether their answer is correct or not.

Outside the loop to display how much they got correct we can use an f-string just like we did previously. Since sometimes we'll get a non-terminating decimal, we can use the round function so it rounds to the nearest hundreth.

So let's code this up:

import random

def main():

   correct = 0

   answered  = 0

   while True:

       num1 = random.randint(10, 98)

       num2 = random.randint(10, 98)

       if num1 == num2: # the answer would be zero
           num2 += 1 # makes sure the answer isn't zero

       userInput = int(input(f"{num1} - {num2}"))

       if userInput == 0: # first check if they want to stop

           break

       if userInput == (num1 - num2):
           correct += 1

       answered += 1

   print(f"Correct: {correct}\nIncorrect: {answered - correct}\nPercent: {round(correct/answered, 2)}")

main()

and that should pretty much be it. The last line is just some formatting so it looks a bit better when displaying.

How many subnets and host per subnet are available from network 192.168.43.0 255.255.255.224?

Answers

It is to be noted that from network 192.168.43.0 255.255.255.224 the number of subnets and hosts available are 8 and 32 respectively. Out of the 32 hosts only 30 are usually usable.

What is a host in networking?

A computer or other device linked to a computer network is referred to as a network host. A host can function as a server, providing information resources, services, and programs to network users or other hosts. At least one network address is assigned to each host.

A computer network is a collection of computers that share resources that are located on or provided by network nodes. To interact with one another, the computers employ standard communication protocols across digital linkages.

So with regard to the above answer, note that by entering the data into an online IPv4 subnet calculator, we are able to arrive at the total number of:

8 subnets; and 30 hosts available for 192.168.43.0 (IP Address) and 255.255.255.224 (Subnet)

Learn more about Subnets:
https://brainly.com/question/15055849
#SPJ1

Explain why you would select the waterfall model to implement the baby monitoring system by describing the advantages of using the waterfall model in projects like this which consists of a large scope.

Answers

The waterfall model's benefits includes Teams must follow a set of stages in a waterfall process, never going on until each phase is finished. Smaller projects with clear-cut deliverables from the beginning are best suited for this framework.

Why did you choose waterfall model?

When a project must adhere to stringent guidelines, the waterfall technique is preferable because it calls for deliverables for each step before moving on to the next.

Note that As an alternative, Agile is better suited for teams who want to move quickly, experiment with direction, and start without knowing exactly how the project will turn out.

Therefore, The sequential Waterfall Model separates software development into pre-established segments. Before the following phase can start, each phase must be finished.

Learn more about Waterfall Model from

https://brainly.com/question/14079212
#SPJ1

What is output by the following code? Select all that apply.

c = 2




while (c < 12):

print (c)
c = c + 3

Answers

When the above code is run via a compiler, the output will be 5.

What is code in programming?

In computer programming, computer code is a set of instructions or a set of rules expressed in a specific programming language (i.e., the source code). It is also the name given to source code after it has been compiled and is ready to execute on a computer.

The print() method outputs the message supplied to the screen or another standard output device. The message can be a string or any other object, which will be transformed to a string before being displayed on the screen.

When the above code is correctly entered into the compiler and rightly indented, the output given is 5.

Learn more about compilers:
https://brainly.com/question/27882492

#SPJ1

Problem: A company wants a program that will calculate the weekly paycheck for an employee based on how many hours they worked. For this company, an employee earns $20 an hour for the first 40 hours that they work. The employee earns overtime, $30 an hour, for each hour they work above 40 hours.

Example: If an employee works 60 hours in a week, they would earn $20/hr for the first 40 hours. Then they would earn $30/hr for the 20 hours they worked overtime. Therefore, they earned: ($20/hr * 40hrs) + ($30/hr * 20 hrs) = $800 + $600 = $1400 total.

For this assignment, you must create pseudocode and a flowchart to design a program that will calculate an employee’s weekly paycheck.

Write pseudocode to design a programming solution by outlining a series of steps and using appropriate indentation and keywords. As you write your pseudocode, be sure to consider the following:
What input does the computer need?
What steps does the program need to follow to process the input? What output should result?
When might you need to use decision branching? If you used decision branching, did you account for all possible input values?
Did you use appropriate indentation and keywords (such as IF, ELSE, CALCULATE, and so on) throughout your pseudocode?
Create a flowchart to design a programming solution by organizing a series of steps and using appropriate symbols and arrows. As you create your flowchart, be sure to use appropriate arrows and symbols for each of the following:
Start and end points
Input and output
Decision branching
Processing steps
Note: You may find the correct shapes to create your flowchart on the Insert menu in Microsoft Word. Or you may draw your flowchart by hand, take a clear picture, and insert the picture into your Word document. Use the add shapes or insert pictures tutorials to help you. You could also use a flowcharting tool that you are familiar with, such as Lucidchart, if you prefer.

Answers

Using the knowledge in computational language in pseudocode  it is possible to write a code that programming solution by outlining a series of steps and using appropriate indentation and keywords.

Writting the code:

h = int(input('Enter hours '))

rate = 20

if h <= 40:

   pay = h * rate

elif h > 40:

   pay = ((h-40) * rate * 1.5) + rate * 40

print("Your pay is %.2f" % pay)

Set hourly rate to 20

Input hours worked

If hours worked is under 40

   Compute hours worked times hourly rate equals pay

Else hours worked is over 40

   Compute ?

Endif

Print pay

See more about pseudocode at brainly.com/question/12975450

#SPJ1

Design a flowchart or pseudocode for a program that accepts two
numbers from a user and displays one of the following messages: First
is larger, second is larger, and numbers are equal.

Answers

Using the knowledge in computational language in python it is possible to write the code that design a flowchart or pseudocode for a program that accepts two numbers from a user and displays

Writting the code:

firstNum=int(input("enter the firstNum "))

secondNum=int(input("enter the secondNum "))

First="First is larger"

Second="Second is large"

Equal="Numbers are equl"

if firstNum>secondNum:

print(First)

elif(secondNum>firstNum):

print(Second)

else:

print(Equal)

See more about python at brainly.com/question/18502436

#SPJ1

A ____ risk assessment evaluates threats to and vulnerabilities of the network.

Answers

Answer:

Vulnerability

Explanation:

Vulnerability refers to a weakness in your hardware, software, or procedures

3. Programmers use indenting to organize their code so that it is readable and can be easily debugged. x = 12 if x ==12: print ("x is equal to 12.")

Which of the following keys on the keyboard is used to quickly indent text?
*
Control
Return
Tab
Right Arrow

Answers

Answer:Quickly indent text can be done using key Tab on the keyboard.

Answer: Option C

Explanation:

Code is readable and can be easily debugged because programmers use indenting to organize it . In a computer, any programmer to develop a program both space and tab keys can be used to indent text.

Tab key used to indent the text quickly whereas the space key used to indent text but not to indent text quickly. Tab can be used as the standard key for indenting in the computer programs.

Explanation:

The correct answer would option c

help help help help....​

Answers

Answer:redo reload copy cut paste bullet list highlight bold numbered list center right left.

Explanation:

That's all I can help with right now

1. Review and write summary report on Artificial Intelligence (AI), your report should include from starting point of Al to the future of AI in brief and short way.​

Answers

Summary report on Artificial Intelligence (AI):

The term artificial intelligence broadly refers to the application of technology to perform tasks that resemble human cognitive functioning, and is typically defined as "the ability of a machine to imitate intelligent human behaviour." Artificial intelligence typically involves "the theory and development of artificial intelligence systems capable of performing tasks that normally require human intelligence, such as visual perception, speech recognition, decision making, and  between languages." John McCarthy, one of the founders of the study of artificial intelligence, "defined the field of using computers to do things that are said to be intelligent when people do them."

Artificial intelligence is used as an umbrella term to cover a wide range of different technologies and applications, some of which are mentioned below.

Machine Learning (ML) Natural Language Processing (NLP) Computer vision (CV) Robotics Process Automation (RPA)

AI applications typically involve the use of data, algorithms and human feedback. Ensuring that all these components are properly structured and validated is essential to developing and deploying AI applications.

What is Machine Learning ?

Machine learning is a branch of computer science that uses algorithms to process and learn from large amounts of data. Unlike traditional rule-based programming, ML models10 learn from input data to predict or identify meaningful patterns without being specifically programmed to do so. There are different types of ML models depending on their intended task and structure:

Supervised Machine Learning: In supervised ML, a model is trained with labeled input data that correlates with a specified output. Reinforcement learning: In reinforcement learning, the model learns. dynamically to achieve the desired output through trial and error Unsupervised Machine Learning: In unsupervised ML, the input data is unlabelled and the output is undefined Deep Learning: A deep learning model is built on an artificial neural network where algorithms process large amounts of unlabelled or unstructured data through multiple learning layers  in a way inspired by how neural networks work in the brain

To learn more about machine learning, visit;

https://brainly.com/question/29386217

#SPJ9

Write an expression using Boolean operators that prints "Special number" if special_num is -99, 0, or 44.

Answers

A sample expression that uses Boolean operators that prints "Special number" if special_num is -99, 0, or 44 is given below:

The Program

import java.util.Scanner;

import java.io.*;

public class Test

{

   public static void main(String[]args) throws IOException

   {

       File file = new File("SNUMS.INP");

       Scanner inputFile = new Scanner(file);

       int order = 1;

       int i = 1;

      int[] special = new int[1000000+1];

       // Write all 10^6 special numbers into an array named "special"

       while (order <= 1000000)

       {

           if (specialNumber(i) == true)

           {

              special[order] = i;

               order++;

           }

           i++;

       }

       // Write the result to file

       PrintWriter outputFile = new PrintWriter("SNUMS.OUT");

       outputFile.println(special[inputFile.nextInt()]);

       while (inputFile.hasNext())

           outputFile.println(special[inputFile.nextInt()]);

       outputFile.close();

   }

   public static boolean specialNumber(int i)

   {

       // This method check whether the number is a special number

       boolean specialNumber = false;

      byte count=0;

       long sum=0;

       while (i != 0)

       {

           sum = sum + (i % 10);

           count++;

           i = i / 10;

       }

       if (sum % count == 0) return true;

       else return false;

    }

}

Read more about boolean operators here:

https://brainly.com/question/5029736

#SPJ1

First,

- select a classification methodology to learn in your project. Select either Classification Trees or Support Vector Machines.

- To actually get the data used in the ISLR examples, you will likely need to download an R package called ISLR; it contains the data sets used in the text.

- Begin by introducing your reader to the corporation from which your stock data (Leggett & Platt Incorporated) comes. Tell the reader something you learned about that corporation that you found interesting, something which would demonstrate to a recruiter that you possess curiosity and the ability to employ it.

- Then, using trimmed screenshots where needed from Excel, sketch out for the reader how you converted your Yahoo-sourced stock data into lagged stock risk data set since 2006.

Second,

-draw a random sample of size n=300 without replacement from your stock return data set. Recall that your stock return data contains a HiLo return column and standardized log lag1 and log lag2 return columns. I will call this your n=300 stock return data set. Show and explain how this is done.

- draw another random sample of size 300 without replacement from your stock return data set. Recall that your stock risk data contains a HiLo risk column and standardized log lag1 and log lag2 columns. I will call this your n=300 stock risk data set.

Next, using your n=300 stock return data set, walk through the steps covered by the ISLR text for your chosen method, SVM or CART, explaining in your own words what you are doing. Put your name into the title of any graphs you show.

Finally, run the program on your n=300 stock risk data set and compare the performance to that of your n=300 stock return data set. Include use of the chi-square test. Discuss the differences, the reasons that these would happen, and the lessons learned about the nature of the stock market.

third,

Select one of the tuning parameters or decision criteria that lie beneath the surface of your chosen methodology, CART or CART. Engage with it by researching beyond the ISLR text. Then experiment with it. Experiment with your data and with other data sets. Try decreasing or increasing n. Look at other sources for help, documenting the sources.

Forth,

Create classification space plots for both of your n=300 data sets, using your chosen methodology, SVM or CART. Be sure to explain how you went about this. Create the plot using the same techniques that we did in our plots for other methods.

] Prepare a comparative study of knn, naive Bayes, logistic regression, and your selected method. Make this comparison on your two n=300 data sets, splitting the data randomly in half to get the training and testing sets.

Explain what you are doing as you go along, explain what you understand about what distinguishes the methods, discuss reasons why the results vary, and why there might be systematic differences in performance between return data and risk data. Show classification space plots for knn, naïve Bayes, and logistic regression. At the end, show a single table in which you summarize the overall correct forecast rate for the stock returns for the four methods; then another table summarizing the performance on the stock risk data

Answers

Using the knowledge of the computational language in python it is possible to write a code that Create classification space plots for both of your n=300 data sets, using your chosen methodology, SVM or CART.

Writting the code:

def randomize(X, Y):

   permutation = np.random.permutation(Y.shape[0])

   X2 = X[permutation,:]

   Y2 = Y[permutation]

   return X2, Y2

X2, y2 = randomize(X, y)

def draw_learning_curves(X, y, estimator, num_trainings):

   train_sizes, train_scores, test_scores = learning_curve(estimator, X2, y2, cv=None, n_jobs=1, train_sizes=np.linspace(0.1, 1.0, num_trainings))

   train_scores_mean = np.mean(train_scores, axis=1)

   train_scores_std = np.std(train_scores, axis=1)

   test_scores_mean = np.mean(test_scores, axis=1)

   test_scores_std = np.std(test_scores, axis=1)

   plt.grid()

   plt.title("Learning Curves")

   plt.xlabel("Training examples")

   plt.ylabel("Score")

   plt.plot(train_scores_mean, 'o-', color="g",

            label="Training score")

   plt.plot(test_scores_mean, 'o-', color="y",

            label="Cross-validation score")

   plt.legend(loc="best")

   plt.show()

See more about python at brainly.com/question/18502436

#SPJ1

Can someone help me out with a code. Code's in python write a function that returns the longest common prefix of two strings. For example, the longest
common prefix of distance and disinfection is dis. The header of the method is:
def prefix(s1, s2)
If the two strings have no common prefix, the method returns an empty string.
Write a main function that prompts the user to enter two strings and displays their common
prefix.
here's what I have currently but its not working.
def longestCommonPrefix(self, arr):

arr.sort(reverse = False)
print(arr)
n= len(arr)
str1 = arr[0]
str2 = arr[n-1]

n1 = len(str1)
n2 = len(str2)
result = ""
j = 0
i = 0

while(i <= n1 - 1 and j <= n2 - 1):
if (str1[i] != str2[j]):
break
result += (str1[i])

i += 1
j += 1

return (result)

Answers

Just 10 lines of code.

from functools import reduce

list = []

def compare():

   calc = [reduce(lambda a, b: a if a == b else None, x) for x in zip(*list)] + [None]

   return list[0][:calc.index(None)]

   

list.append(input("Enter the first string: "))

list.append(input("Enter the second string: "))

print(compare())

One of the four function of Information.
Security
is called

Answers

Answer:

The basic tenets of information security are confidentiality, integrity and availability. Every element of the information security program must be designed to implement one or more of these principles. Together they are called the CIA Triad.

The 4 functions of Information Security:It protects the organisation's ability to function.It enables the safe operation of applications implemented on the organisation's IT systems.It protects the data the organisation collects and uses.It safeguards the technology the organisation uses.

The cpu is the component responsible for commanding which other component in the system?

Answers

The CPU is the component responsible for commanding memory in the system. The correct option is 3.

What is a CPU?

The CPU is instructed on what to do next and how to communicate with other components by the operating system, a sizable program.

As you are aware, there are numerous computer operating systems, including the Microsoft Windows operating system. An operating system is a substantial piece of software that controls your computer and aids the CPU in decision-making. The CPU is controlled by an operating system so that it can communicate with other system components.

Therefore, the correct option is 3. Memory.

To learn more about CPU, refer to the link:

https://brainly.com/question/14671593

#SPJ1

The question is incomplete. Your most probably complete question is given below:

1. CPU

2. bus

3. memory

4. I/O subsystem.

Please help! AP CSP problem.

Answers

Answer:

a is the correct answer ok

5. Define a procedure “DistanceBetweenTwoPoints” that will take four paramaters x1, y1, x2
and y2 and will calculate the distance between these two points using the formula
√((x2 – x1)² + (y2 – y1)²). You must use the SquareRoot function you defined previously.
[10 points]

Test case:
> (DistanceBetweenTwoPoints 2 5 3 2)
3.1622776601683795
Can anyone please help me to write this procedure in Scheme Language? I am stuck! Please help!

Answers

Using the knowledge in computational language in JAVA it is possible to write the code that define a procedure “DistanceBetweenTwoPoints” that will take four paramaters x1, y1, x2 and y2.

Writting the code:

package org.totalbeginner.tutorial;

public class Point {

   public double x;

   public double y;

   Point(double xcoord, double ycoord){

       this.x = xcoord;

       this.y = ycoord;

   }

   public double getX() {

       return x;

   }

   public double getY() {

       return y;

   }    

}

package org.totalbeginner.tutorial;

public class Line {

   double x;

   double y;

   Point p1 = new Point(2.0,2.0);

   Point p2 = new Point(4.0,4.0);

   Point mp = new Point(x,y);

   public void midpoint() {

       x = (p1.getX() + p2.getX()) / 2;

       y = (p1.getY() + p2.getY()) / 2;

   }

See more about JAVA at brainly.com/question/12975450

#SPJ1

Other Questions
did all people have eaual treatment under roman law? funds givern to a state by the national government with speical conditions attached are examples of a revenue sharing b project grants c categorical grants d block grants What two rival armies worked together to defeat the Persians in 499 B.C? A tortoise and a hare run in the NYC marathon (26.2 miles). The hare crosses the finish line first in a time of 4 hours and 30 minutes. How fast did the hare run? 25.0 feet50.0 feet20.6 feet19.4 feet Please help me out putting these sentences in MODERN day sentences. You basically have to change these sentences into modern day language. I'd really appreciate the help. :)Article II. Each state retains its sovereignty, freedom and independence, and every Power, Jurisdiction and right, which is not by this confederation expressly delegated to the United States, in Congress assembled. Modern Day:__________________________Article III. The said states hereby severally enter into a firm league of friendship with each other, for their common defence, the security of their Liberties, and their mutual and general welfare, binding themselves to assist each other, against all force offered to, or attacks made upon them, or any of them, on account of religion, sovereignty, trade, or any other pretense whatever. Modern Day:______________Article IV. The better to secure and perpetuate mutual friendship and intercourse among the people of the different states in this union, the free inhabitants of each of these states, paupers, vagabonds and fugitives from Justice excepted, shall be entitled to all privileges and immunities of free citizens in the several states; Modern Day:________________Article VI. No State, without the Consent of the united States, in congress assembled, shall send any embassy to, or receive any embassy from, or enter into any conference, agreement, alliance, or treaty, with any King prince or state;Modern Day:_________________ 3) mary looked in her science book at a picture of the solar system. the planets were large and colorful but she knew it was not an accurate model. why? C++ Perform the task specified by each of the following statements: a) Write the function header for function zero that takes a long integer array parameter bigIntegers and does not return a value.b) Write the function prototype for the function in part (a). c) Write the function header for the function add1AndSum that takes an integer array parameter oneTooSmall and returns an integer.d) Write the function prototype for the function described in part (c). both playing in the sandbox. lars is making a tower and sid is making roads, so that he can drive his matchbox cars. their interactions consist of sharing and borrowing toys. this is an example of Making a certain shade of paint requires mixing 3 parts silver with 4 parts green. Meg uses this data to start this table of equivalent ratios. A 2-column table has 3 rows. Column 1 is labeled Silver paints (parts) with entries 3, blank, blank. Column 2 is labeled Green paint (parts) with entries 4, blank, blank. Which ratios are equivalent to 3 parts silver paint to 4 parts green paint? Check all that apply. 4:5 6:8 5:6 9:12 a plane has a cruising speed of 250 miles per hour when there is no wind. at this speed, the plane flew miles with the wind in the same amount of time it flew miles against the wind. find the speed of the wind. a donor gave $50,000 to a nongovernmental, not-for-profit charity with instructions that the funds be transferred to an individual who lost his home in a fire. the not-for-profit would: what is the average flow rate in cm3/s of gasoline to the engine of a car traveling at 104 km/h if it averages 8.0 km/l? (you do not need to enter any units.) Name the three most commonprokaryotic shapes?A. bacteria, archaea, and protistsB. cocci, bacilli, and spirilla thisC. Neither of these actors who color a role by filtering it through their own personal qualities, instincts, and abilities are known as Which of the following courses might a genetic engineer take in college?O Introduction to HorticultureO Principles of Plant AgricultureO Maneuvering Controlled VehiclesO Recombinant DNA Applications 9-(-0.87)-0.3 will someone please help me I cant remember how todo this and my kid needs my help! the world trade organization: group of answer choices is also known as nafta. is also known as the international monetary fund (imf). was established to resolve disputes arising under world trade rules. enhances world trade by providing interest rate subsidies to foreign borrowers who buy exports on credit. Suppose that 12 inches of wire cost 48 cents at the same rate how many inches of wire can be bought for 28 cents erin purchased stock with an initial share price of $15, and sold it when the share price was $17. while she owned the stock, she earned $2 in dividends. what was her total percentage return on the investment? a.) 22.67% b.) 23.53% c.) 11.76% d.) 26.67%