4.3 lesson practice:
1. Count variable loop
2. User input
3. Count variable loop
Suppose you change the program in the last problem so the user enters exactly 17 numbers, the loop would then be an example of a count variable loop.
It should be noted that a count variable loop refers to a control type of program loop that is controlled by an integer which counts up from an initial value to an upper limit.
From the complete question, when the user changes the program in the last problem so the user enters exactly 17 numbers, the loop would then be an example of a count variable loop.
Read related link on:
https://brainly.com/question/19584494
Do you think the human race will benefit from advanced AI?
Answer:
Yes and no
Explanation:
I think that we would benefit to an extent, however we could foreseeable future where they out smart us. For our everyday lives advanced AI could be a great help to us, we just have to make sure we keep it in control.
Examples of fifth generation
Answer:
Intelligent systems that could control the route of a missile and defense-systems that could fend off attacks; Word processors that could be controlled by means by speech recognition; Programs that could translate documents from one language to another.
Hope this helps :)
Write code that creates a Python set containing each unique character in a string named my_string. For example, if the string is 'hello', the set would be {'h', 'e', 'l', 'o'} (in any order). Assign the set to a variable named my_set. Assume that my_string has already been initialized.
my_set = set(my_string)
This creates a set of the unique characters of the variable my_string
The code that creates a Python set containing each unique character in a string is as follows:
my_string = "Hello"
my_set = set(my_string)
print(my_set)
Code explanation:The code is written in python.
The first line of code, we named a variable "my_string" and stored a string "hello" in it.The my_set variable is used to store the set value of our the string "Hello".Finally, we print the my_set value to get the sets of our string.learn more on string here: https://brainly.com/question/15292660
By default, Outlook displays messages in the Content pane grouped by the
Answer: c
Explanation:
Project 15A - Math Application
package: proj15A
Classes: Main, Circle, Rectangular
Using your new knowledge of methods and classes create a program with an interface. The program must allow a user to enter values and calculate: Areas, Perimeters, Surface Area, and Volumes for circular and rectangular shapes.
The program must have three classes. A main class, circle class and a rectangular class.
Submit all code one after the other as text into Canvas in the following order.
• main.class
• circle.class
• rect.class
I have it all done just need to finish this code
package math;
import java.util.Scanner;
public class Main
{
public static void main(String[] args)// main method
{
Scanner nScan = new Scanner(System.in);
DecimalFormat mf = new DeciamlFormat("0.0");
Circle cir1 = new Circle(0,0);
Rectangle rec1 = new Rectangle (0,0,0);
//variables
boolean runProg = true;
int choice =0;
while(runProg)
{
System.out.print("Math calculator 3000 ver1");
System.out.print("choose a mode. \n"
+ "1 circle mode \n"
+ "2 Rectangle mode \n"
+ "3 End program");
choice = nScan.nextInt();
if(choice==1) //circle mode
{
}
else if(choice == 2) //Rectangle Mode
{
}
else if(choice == 3) //Program Shutdown
{
}
else
{
System.out.println("You may only choose 1-3. Try again.");
}
}
nScan.close();
}
}
Answer:
A simple php code for the following is given below:
Explanation:
interface Calculate {
public function area($lenght,$width);
public function perimeter($length,$width);
public function surfaceArea($length_side_1,$length_side_2);
public funcction volume($length, $width, $height):
}
interface Calculate2 {
public function area($raidus);
public function perimeter($radius);
public function surfaceArea($radius);
public funcction volume($radius):
}
Class Mian{
width=please Enter the value of width
height=please Enterr the value of height
length=please enter the value of length
lenght2=please enter the value of lenth of side 2
ridus= please enter the value of radius
Circle = new circle()
Rectangle = new rectangle()
}
Class Circle implements Calculate2{
public function area(){
area= pi*r
return area
}
public function perimeter(){
perimeter=2*pi*r
return perimeter
}
public function surfaceArea(){
surfacearea= pi*r*r
}
public function volume(){}
area=area()
volume=area*height
return volume
}
Class Rectangle implements Calculate{
public function area(lenght,width){
area= length * width
return area
}
public function perimeter(lenght,width){
perimenter=2(lenght+width)
return perimeter
}
public function surfaceArea(length_side_1, withd right place){}
surface_area 2*length_side_1 f* length_side_2_
public function volume(){}
public surface volume(length,width,height)
volume= length * width * height
return volume
}
A device involved in a Transmission Control Protocol (TCP) connection is ready to close the connection. The other device in the connection agrees. What has occured?
Answer:
A four-way handshake has occurred.
Explanation:
TCP or transmission control protocol is a packet-oriented protocol because all lost packets are retransmitted if not received and acknowledged by the destination host.
A four-way handshake connection is established between the server and the client, this allows for connection initiation, negotiation, and termination. The packets sent across are never lost as received packets are acknowledged by the client by sending an ACK to the transmitting server.
The TCP is a main protocol for the internet protocol suite and initiates the network implementation, by complementing the IP. It connection-oriented protocol.
The device that has connected with the TCP undergo a four-way handshake, which is the process of exchanging four messages between the access point. This allows for the generation of encryption keys that are sued to encrypt the data.Learn more about the Transmission Control Protocol.
brainly.com/question/16398493.
Please write in Java, 35PTS
Write a program called Teen that takes a sentence and returns a new sentence based on how a teenager might say that. The method that creates the new string should be called teenTalk and should have the signature shown in the starter code.
The way to do that is to put the word "like" in between each of the words in the original sentence.
For example, teenTalk("That is so funny!") would return "That like is like so like funny!".
Sample output:
Sonequa Martin-Green is in grade 10 and wants to send this text:
Enter the text message being sent:
Hello world how are you doing?
The teen talk text would be:
Hello like world like how like are like you like doing?
import java.util.Scanner;
public class JavaApplication76 {
public static String teenTalk(String message){
String newMessage = "";
for (int i = 0; i < message.length(); i ++){
char c = message.charAt(i);
if (Character.isWhitespace(c)){
newMessage += " like ";
c = Character.MIN_VALUE;
}
newMessage += c;
}
return newMessage;
}
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.println("Enter the text message being sent:");
String message = scan.nextLine();
System.out.println("The teen talk text would be:");
System.out.println(teenTalk(message));
}
}
I hope this helps!
How is LUA different from Python?
Give an example.
This is the answer I couldn't write it here since brainly said it contained some bad word whatever.
Answer:
good old brainly think stuff is bad word even tho it is not had to use txt file since brainly think code or rblx is bad word
python code 100 Random Numbers (twice)
python code
instructions:
You need to write code that will print two bricks of numbers, one with integers, one with decimals.
import random
i = 1
while i <= 100:
print("#"+str(i)+": "+str(random.randint(1,100)), end=", ")
i+=1
print()
i = 1
while i <= 100:
print("#"+str(i)+": "+str(random.uniform(1,100)), end=", ")
i += 1
I hope this helps!
PLEASE HELP
what are some benefits of using graphic on web page?
Images help tell a story where describing with words is either too lengthy, or practically impossible. For instance, you could have a map of a location and various arrows and other markings to describe movements of troops during a battle of the civil war. This is one example of many that you could have as an image on a website. Describing the troop movements with words only may be really difficult to do. Plus many people are visually oriented learners, so they benefit with images every now and then. Of course, it's best not to overdo things and overload the site with too many images. A nice balance is needed.
ghfwkjefffffffffffwhlej,fwhn
Answer:
huh
Explanation:
Answer:
you good?
Explanation:
In binary, the second digit from the right is multiplied by the first power of two, and the _____ digit from the right is multiplied by the fourth power of two.
A. Fourth
B. Fifth
C. Sixth
Answer:
Your answer would be, B. Fifth digit ftom the right.
Explanation:
Binary with letters works like this,
the first 3 bits from the left, determine if the character is caps or lowercase, 010 is capital and 011 is lowercase, the next 5 are like this,
First - 2 to the power of four
Second - 2 to the power of three
Third - 2 to the power of two
Fourth - 2 to the powet of one
Fifth - 2 to the power of zero
So, given that information, the fourth digit from the right is 2 to the power of the three. The sixth digit is a bit to determine the capitalization, so the only answer left is B.
In binary, the second digit from the right is multiplied by the first power of two, and the fifth digit from the right is multiplied by the fourth power of two.
What is a binary number?The base-2 numeral system, often known as the binary numeral system, is a way of expressing numbers in mathematics that employs only two symbols, typically "0" and "1."
The character's case is determined by the first three bits from the left, 010 is capitalized, 011 is lowercase, and so on for the following 5.
First - 2 to the power of four
Second - 2 to the power of three
Third - 2 to the power of two
Fourth - 2 to the powet of one
Fifth - 2 to the power of zero
The fourth digit from the right is therefore 2 to the power of three given the information above. The only option left is B because the sixth digit is a bit to determine capitalization.
Therefore, the correct option is B. Fifth.
To learn more about binary numbers, refer to the link:
https://brainly.com/question/15766517
#SPJ2
Which of the following is a common use for spreadsheets?
A.
storing graphical data
B.
planning a monthly budget
C.
formatting text for presentability
D.
verifying data validity
You are given with a list of integer elements. Make a new list which will store square of elements of previous list. How can I do this on Python
We declare our lst variable with a list of different integers.
We then use list comprehensions to create a list of all of the elements in our lst variable squared. We print the new list to the console.
Write a program that performs a simulation to estimate the probability of rolling five of a kind in a single toss of five six-sided dice. Show your results when running 100 Monte Carlo trials, 10,000 Monte Carlo trials, and 1,000,000 Monte Carlo trials.Signature:probability_five_of_a_kind(num_trials)return typestring (formatted to show eight decimal places)Test case:>>> pro bability_five_of_a_kind(500_000)'The probability_five_of_a_kind is 0.00074000'
Answer:
import random
def probability_five_of_a_kind(num_trials):
sums = 0
for _ in range(num_trials):
roll_1 = random.randrange(1,6, 1)
roll_2 = random.randrange(1,6, 1)
roll_3 = random.randrange(1,6, 1)
roll_4 = random.randrange(1,6, 1)
roll_5 = random.randrange(1,6, 1)
collection = roll_1 + roll_2 + roll_3 + roll_4 + roll_5
if collection == 5:
sums += 1
prob = round(sums/7776, 8)
print(f"The probability_five_of_a_kind is {prob}")
probability_five_of_a_kind(100)
probability_five_of_a_kind(10000)
probability_five_of_a_kind(1000000)
Explanation:
The random package of the python language is used to select an integer value from the range of one to six representing the sides of a die. All six rolls are randomized and the sum. If the sum is equal to 5, the sums counter is incremented. At the end of the loop, the sum is divided by the five dices events (which is 6^5 = 7776).
Melissa is updating her class Cell. She has written the following code, but it will not compile. Where is her error?
public class Cell
{
private int chromosomes, rna;
public double time, h2o;
private static int cellCount = 0;
private static double mCount = 4.0;
public Cell()
{
chromosomes = 23;
rna = 1;
h20 = 2.0;
cellCount++;
System.out.println(“There are now ” + cellCount + “ cells”);
}
public Cell(int a_chromosomes, int a_rna, double a_h20)
{
chromosomes = a_chromosomes;
rna = a_rna;
this();
h20 = a_h20;
cellCount++;
System.out.println(“There are now ” + cellCount + “ cells”);
}
public void printInfo() {
System.out.println(“chromosomes: ” + chromosomes);
System.out.println(“rna: ” + rna);
System.out.println(“h2o: ” + h2o);
}
public int getChromosomes()
{
if (chromosomes < 1) {
throw new IllegalArgumentException(“chromosomes is less than 1”);
}
return chromosomes;
}
public double get_mCount()
{
return mCount;
}
}
Reset
A. chromosomes = a_chromosomes;
B. this();
C. cellCount++;
D. return chromosomes;
Answer:
C. cellCount++ -- is incementing a static variable
b. Some of Company X's new practices and systems are unethical. Business ethics is a set of codes
about how a business should conduct itself. In what ways is Company X not applying ethical practices?
(1 point)
Answer:
They are changing schedules without proper notice, cutting workers without proper notice and falsely advertising.
Explanation:
Ashley has included a bar graph in a term paper she's authoring using a word processor. To make sure that the graph is not cut off when
printed, she decides that the page with the graph should be printed horizontally. What should Ashley do?
Answer:
she should make sure to put the paper in the right way
Explanation:
Interface elements include but are not limited to:
Question 10 options:
A)Navigational components, informational components, visual design
B)Input controls, informational components, visual design
C)Input controls, navigational components, visual design
D)Navigational components, containers, interaction design
E)Input controls, informational components, containers
Answer:
E
Explanation:
Interface elements include but are not limited to E. Input controls, informational components, containers.
User interface elements refer to the parts that are used in building websites and applications. They're important for adding interactivity to the interface of a user.
It should be noted that the interface elements include navigational components, informational components, input controls, and containers.
Therefore, the last option depicts this as the navigational component isn't added.
Read related link on:
https://brainly.com/question/19593397
Lets assume we are writing a system to backup a list of transactions: class Transaction 1 String TransactioniD: Date TranactionTime: Account account: enum Type(ADD, EDIT, ADMIN): Type type: Transactions are constantly added to the system as quickly as possible (hundreds a minute) and occasionally, your system will need to retrieve them but only if there is a error with the main system (once or twice per million transactions). Additionally, transactions may not come in order as some transactions take longer to process. What is the best way to store the transactions in your system? a) as a list sorted by transactionID b) As an unsorted list of transactions c) as a list sorted by transaction Time d) As a list sorted by a new systemiD int since they transactions are not coming into our system in order of time. Activate Windows Go to Settings to activate Windo e) As a 2d list with the columns sorted by Account and the rows sorted by date
Answer:
The answer is "Option d"
Explanation:
In this question, the easiest way that will save the payment on your database in such a process ID-sorting list would be to mark a payment, that's been recorded mostly on the database whenever this payment became used serial number is not transaction ID, and the wrong choice can be defined as follows:
In choice a, It is wrong because it may be processed, however, payments aren't entered through our process, which does not help remove older.In choice b, the unordered list would not enable any transaction to only be retrieved, that's why it is wrong.In choice c, it will not be helpful because the includes video is either begin or complete the payment, it will not be helpful to hold it with transaction time.In choice e, this approach won't help to identify the payments since one date will have a lot of payments over a certain account.A group consists of 10 kids and 2 adults. On a hike, they must form a line with an adult at the front and an adult at the back. How many ways are there to form the line?a. 4.9!b. 2.99!c. 11!d. 11!/2
Answer:
b. 2.9!
Explanation:
There are is a mistake in the question.
Suppose the group consist of 10 kids and 2 adults, the number of ways in which they can form the line is:
= 2! 10!
= 2× 1× 10!
= 2.10!
But since that is not in the given option.
Let assume that the group consists of 9 kids and 2 adults, the number of ways in which they can form the line is:
No of ways the kids can be permutated = 9 ways
No of ways the adult can be permutated = two ways.
Thus; the number of ways in which they can form the line = 2! 9!
= 2 × 1× 9!
= 2.9!
You need to subnet a network that has 5 subnets, each with at least 16 hosts. Which classful subnet mask would you use?A. 255.255.255.192B. 255.255.255.224C. 255.255.255.240D. 255.255.255.248
Answer:
B. 255.255.255.224
Explanation:
Subnetting in networking is a process of reducing the number of wasted IP addresses used in a network. There are three major classes of IP address, they are, Class A, B, and C with respective network addresses of 1,2, and 3 octets of the subnet mask.
255.255.255.0 is a class C IP address, it only has one subnet mask and 256 host address. In a network of 16 to 30 hosts, 226 to 240 addresses would be wasted. Subnetting the address to have five subnets reduces the IP addresses used.
The new subnet mask becomes 255.255.255.224 borrowing 3 bits from the fourth octet to give 8 subnet masks and 30 host IP addresses.
How can you get to the Excel Function Reference information? Check all that apply.
Help tab
Esc
F1
searching in the Tell Me bar
Ctrl+R
Answer: Help tab, F1, tell me bar
Explanation:
Answer:
Help tab, F1, tell me bar
Explanation:
I got it right
Using the estimated regression model, what median house price is predicted for a tract in the Boston area that does not bound the Charles River, has a crime rate of 0.1, and where the average number of rooms per house is 6?
Answer:
The predicted median house price "medv" is $20,775.
Explanation:
The python code below uses the python's scikit-learn package to program the housing model using multiple factor linear regression.
import pandas as pd
from sklearn.linear_model import LinearRegression
from sklearn.model_selection import train_test_split
df = pd.read_csv('Boston.csv')
df.head(10)
y = df[['medv']]
x = df[['crim', 'chas', 'rm']]
x_train, x_test, y_train, y_test = train_test_split(x, y, train_size=0.75, test_size=0.25, random_state=0)
regr = LinearRegression()
regr.fit(x_train, y_train)
print(regr.coef_)
result = (regr.predict([[0.1,0,6]])).tolist()
print(f"The mean price of house in boston with 6 rooms: {round(result[0][0], 2)}")
Described FOUR (4) issues that possibly raised when the organization does
not emphasize the code of ethics concerning to the software engineering
issues?
Explanation:
1- Information theft: One of the problems that can arise when an organization does not develop an efficient code of ethics regarding software engineering is the use of confidential information for its own benefit or for the benefit of third parties.
2- Access to confidential information: An organization has private information that can only be accessed by the top hierarchy, such as management decisions, performance indexes, etc. Therefore, an unethical attitude would be a software engineer to access such information and have access to information. confidential.
3- Intrapersonal conflicts: It is possible that there is hacker interference in an organization to harm some team or collaborator, exposing facts and rumors for the generation of conflicts and exposure.
4- Asset theft: Accessing some system vulnerabilities, it is possible to access the organization's bank accounts by stealing financial assets without leaving a trace.
what is social media
Answer:
websites and applications that enable users to create and share content or to participate in social networking.
Explanation:
Instructions
Which of the connection types listed is
used to support analog telephony?
Answer:
Analog telephone connections , ISDN, Voice-over-IP (VoIP) telephone connections.
Explanation:
Analog telephone connections , Integrated Services Digital Network (ISDN) telephone connections and Voice-over-IP (VoIP) telephone connections are the three network connection types that support analog telephony. Voice packets are transmitted via three cable connections to various ports in the network.
Date Time Manipulation Exploration If you start from Jan 1st, 1757, and repeatedly add 8 days, until you hit 1800, how many times will it be a Monday? # YOUR CODE HERE def calcDays (): my_date = date(1757, 1, 1) m = 0 while my_date.year != 1800 : my_date = my_date + timedelta(days = 8) if my_date.isoweekday () == 1: m += 1 return m Make a function Once you have answered this question, convert your code into a generalized function. This function, call it count_weekdays should take: start_date: a start date (a datetime object) add_days : a number of days to add (an int) • stop_year: a stop year (an int) • weekday : a day to count, represented in isoweekday format (an int) It should return the number of weekday is that occur from the start date, until stop year, when adding add_days days.
Answer:
from datetime import datetime, date, timedelta
def count_weekdays(start_date, add_days, stop_year, weekday):
my_date = start_date
m = 0
while my_date.year != stop_year:
my_date = my_date + timedelta(days = add_days)
if my_date.isoweekday() == weekday:
m += 1
return m
date_val = date(1757,1,1)
try:
date_val = datetime.fromisoformat(input("Enter date in the format yyyy-mm-dd: "))
except ValueError:
print("Wrong isoformat string")
print(count_weekdays(date_val, 8, 1800, 1))
Explanation:
The datetime package of the python programming language has several time modules like the date, datetime, pytz, timedelta, etc, used to manipulate date and time in documents. The function count_weekdays has four parameters and returns the number of a specified weekday in a period of time.
There are a few errors in the code provided in the Code Editor. Your task is to debug the code so that it outputs the verses correctly.
animal = input("Enter an animal: ")
sound = input ("Enter a sound: ")
e = "E"
print ("Old Macdonald had a farm, " + e)
print ("And on his farm he had a" + animal + "," + e)
print ("With a " + animal + "-" + animal + " here and a" + sound + "-" + sound + " there")
print ("Here a "+ sound+ " there a " +sound)
print ("Everywhere a" + sound + "-" + animal )
print ("Old Macdonald had a farm," + e)
animal = input("Enter an animal: ")
sound = input("Enter a sound: ")
e = "E"
print("Old Macdonald had a farm, " + e)
print("And on his farm he had a " + animal + ", " + e)
print("With a " + animal + "-" + animal + " here and a " + sound + "-" + sound + " there")
print("Here a " + sound + " there a " + sound)
print("Everywhere a " + sound + "-" + animal)
print("Old Macdonald had a farm, " + e)
This works for me. Best of luck.
Answer:
animal = input("Enter an animal: ")
sound = input ("Enter a sound: ")
e = "E-I-E-I-O"
print ("Old Macdonald had a farm, " + e)
print ("And on his farm he had a " + animal + ", " + e)
print ("With a " + sound + "-" + sound + " here and a " + sound + "-" + sound + " there")
print ("Here a "+ sound+ " there a " +sound)
print ("Everywhere a " + sound + "-" + sound )
print ("Old Macdonald had a farm, " + e)
Explanation:
Which of these could be a valid IPv4 or IPv6 address?
a
251.70.349.287
b
eeed:6654:2f34:94cf:bfa0:20c9:08e1:bfcd
c
92.169.42.163
d
67d250:4650d2:94b753:f27588:a49175:0e46be:368442:70fd8d
e
146.49.98.20.184.223
f
4b32:3b3d:6cec:8438:d20f:397c
Answer:
F
4b32:3b3d:6cec:8438:d20f:397c
An IP address is a numerical protocol address with an numerical value that is connected by a computer network for communication.
The IPv4 is a 32-bit address and the IPv6 is a 128-bit address. The IPv4 address usually represents dot-decimal notions. Each range from 0 to 255. The Ip address may be represented by hexadecimal, octal and binary decimals. Thus the valid IPv4 could be a 92.169.42.163Hence the correct option is C.
Learn more about which could be the valid IPv4 or 6.
brainly.in/question/35357295.