sent = input("")
count = 0
new_sent = ""
for i in sent:
if count == 0:
new_sent += i
count += 1
else:
if i.isupper():
new_sent += " "+i.lower()
else:
new_sent += i
print(new_sent)
The above code works if the user enters the sentence.
def func(sentence):
count = 0
new_sent = ""
for i in sentence:
if count == 0:
new_sent += i
count += 1
else:
if i.isupper():
new_sent += " " + i.lower()
else:
new_sent += i
return new_sent
print(func("StopAndSmellTheRoses."))
The above code works if the sentence is entered via a function.
Dance dance1 = new Dance("Tango","Hernandos Hideaway");
Dance dance2 = new Dance("Swing","Hound Dog");
System.out.println(dance1.toString());
System.out.println(dance2.toString());
class Dance
{
private String name;
private String song;
public Dance(String name, String s)
{
this.name = name;
song = s;
}
public String toString()
{
return name + " " + song;
}
}
What is printed when the program is executed?
a
null null
null null
b
Hernandos Hideaway null
Hound Dog null
c
null null
Swing Hound Dog
d
Tango Hernados Hideaway
Swing Hound Dog
e
null Hernandos Hideaway
null Hound Dog
Answer:
The output of the program is (d)
Tango Hernados Hideaway
Swing Hound Dog
Explanation:
Analyzing the given code segment
In class Dance,
A method named dance was defined with an instance of two string variables/values
which are name and song
public Dance(String name, String s)
In the main of the program,
The first line creates an instance of Dance as dance1
dance1 is initialized with the following string values: "Tango","Hernandos Hideaway"
- The first string value "Tango" will be passed into the name variable of the Dance method
- The second string value "Hernandos Hideaway" will be passed into the song variable of the Dance method
Next, another instance of Dance is initialized as dance2
dance2 is initialized with the following string values: "Swing","Hound Dog"
- The first string value "Swing" will be passed into the name variable of the Dance method
- The second string value "Hound Dog" will be passed into the song variable of the Dance method
On line 3 of the main: System.out.println(dance1.toString());
The values of dance1, which are "Tango","Hernandos Hideaway" are printed
On line 4 of the main: System.out.println(dance2.toString());
The values of dance1, which are "Swing","Hound Dog" are printed
Hence, option d answers the question
A scared kangaroo clears a fence that is 2.44 meters tall. What is the vertical component of the kangaroos velocity at take off ? If the horizontal component of the kangaroos velocity is 4.80 m per s at what angle did the kangaroo take off the ground? (hint: at its maximum height the kangaroos vertical velocity is 0)
Answer:
a) The vertical component of the kangaroo's velocity at take off is approximately 4.982 meters per second.
b) The angle at which the kangaroo took off the ground is approximately 46.066º.
Explanation:
a) According to the statement, the kangaroo has an initial horizontal velocity and jumps to overcome the fence until velocity becomes zero. If effects from non-conservative forces can be neglected, then we represent the situation of the kangaroo by Principle of Energy Conservation:
[tex]K_{1}+U_{g,1} = K_{2}+U_{g,2}[/tex] (Eq. 1)
Where:
[tex]K_{1}[/tex], [tex]K_{2}[/tex] - Initial and final translational kinetic energies, measured in joules.
[tex]U_{g,1}[/tex], [tex]U_{g,2}[/tex] - Initial and final gravitational potential energies, measured in joules.
By definitions of translational kinetic and potential gravitational energies, we expand and simplify the equation above:
[tex]\frac{1}{2}\cdot m\cdot [(v_{1,x}^{2}+v_{1,y}^{2})-(v_{2,x}^{2}+v_{2,y}^{2})] = m\cdot g \cdot (y_{2}-y_{1})[/tex]
[tex]\frac{1}{2}\cdot [(v_{1,x}^{2}+v_{1,y}^{2})-(v_{2,x}^{2}+v_{2,y}^{2})] = g \cdot (y_{2}-y_{1})[/tex] (Eq. 2)
Where:
[tex]m[/tex] - Mass of the kangaroo, measured in kilograms.
[tex]g[/tex] - Gravitational acceleration, measured in meters per square second.
[tex]y_{1}[/tex], [tex]y_{2}[/tex] - Initial and final heights of the kangaroo above the ground, measured in meters.
[tex]v_{1,x}[/tex], [tex]v_{1,y}[/tex] - Vertical and horizontal initial velocities, measured in meters per second.
[tex]v_{2,x}[/tex], [tex]v_{2,y}[/tex] - Vertical and horizontal final velocities, measured in meters per second.
If we know that [tex]v_{1,x} = 4.80\,\frac{m}{s}[/tex], [tex]v_{2, x} = 0\,\frac{m}{s}[/tex], [tex]v_{2,y} = 0\,\frac{m}{s}[/tex], [tex]g = 9.807\,\frac{m}{s^{2}}[/tex] and [tex]y_{2}-y_{1} = 2.44\,m[/tex], then (Eq. 2) is reduced into this:
[tex]11.52+0.5\cdot v_{1,y}^{2}=23.929[/tex]
Lastly, we solve for [tex]v_{1,y}[/tex]:
[tex]0.5\cdot v_{1,y}^{2}=12.409[/tex]
[tex]v_{1,y}^{2} = 24.818[/tex]
[tex]v_{1,y} \approx 4.982\,\frac{m}{s}[/tex]
The vertical component of the kangaroo's velocity at take off is approximately 4.982 meters per second.
b) The angle at which the kangaroo took off the ground ([tex]\theta[/tex]), measured in sexagesimal degrees, is obtained by the following inverse trigonometric relation:
[tex]\theta =\tan^{-1}\left(\frac{v_{1,y}}{v_{1,x}} \right)[/tex] (Eq. 3)
[tex]\theta = \tan^{-1}\left(\frac{4.982\,\frac{m}{s} }{4.80\,\frac{m}{s} } \right)[/tex]
[tex]\theta \approx 46.066^{\circ}[/tex]
The angle at which the kangaroo took off the ground is approximately 46.066º.
A Protocol for networked information
Answer:
Internet Protocol (IP), which uses a set of rules to send and receive messages at the Internet address level; and. additional network protocols that include the Hypertext Transfer Protocol (HTTP) and File Transfer Protocol (FTP), each of which has defined sets of rules to exchange and display information.
Explanation:
could i plz have brainliest so close to next rank
answer 1 question and get 10 points in return
Answer:
3
Explanation:
sorry if I'm wrong...it's been a while since I took a coding class.
What game is this? helpppppp
Answer:
the sims lol
Explanation:
Write an application that counts the total number of spaces contained in a quote entered by the user.
Answer:
Explanation:
The following code is written in Java. It asks the user for an input and saves it in a String variable. Then it loops through all the characters in the string and counts the spaces. Finally, it prints the total number of spaces in the String.
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Enter Line Now:");
String userInput = in.nextLine();
int spaceCount = 0;
for (int x = 0; x < userInput.length(); x++) {
if (userInput.charAt(x) == ' ') {
spaceCount++;
}
}
System.out.println(spaceCount);
}
Write a program that creates an integer array with 40 elements in it. Use a for loop to assign values to each element of the array so that each element has a value that is triple its index. For example, the element with index 0 should have a value of 0, the element with index 1 should have a value of 3, the element with index 2 should have a value of 6, and so on.
Answer:
public class Main
{
public static void main(String[] args) {
int[] numbers = new int[40];
for (int i=0; i<40; i++){
numbers[i] = i * 3;
}
for (int i=0; i<40; i++){
System.out.println(numbers[i]);
}
}
}
Explanation:
*The code is in Java.
Initialize an integer array with size 40
Create a for loop that iterates 40 times. Inside the loop, set the number at index i as i*3
i = 0, numbers[0] = 0 * 3 = 0
i = 1, numbers[1] = 1 * 3 = 3
i = 2, numbers[2] = 2 * 3 = 6
.
.
i = 39, numbers[39] = 39 * 3 = 117
Create another for loop that iterates 40 times and prints the values in the numbers array
How did DDE devices have made our daily life easier?
Answer:
The answer to this question is given below in the explanation section.
Explanation:
DDE (direct data entry) devices are the devices that read data from a source and transfer it directly into the computer. Unlike, other input devices which require physical interaction which requires you to move physically or to do something for an output or feeding data into a computer.
The DDE devices require no hard work while taking input into the computer as compared to other input devices. These DDE devices made our life very easy. Because these devices take input accurately and there are no chances of human error.
The example of DDE devices are magnetic stripe reader, chip reader, Pin pads, optical mark reader, and barcode reader, etc.
These devices have brought great advantages to human life. Because by using these data entry devices, information can be put into very quickly, more accurate than typing and information of the whole page transferred .very quickly and accurately into the system. These devices are also more secure and can hold lots of data, and the data is protected with the PIN (personal identification number). These are also used in ATM machines, handheld, and entry doors.
Answer:
wait is it a write in answer or a multiple choice?
Explanation:
Consider an instruction within a certain instruction-set architecture (ISA): ADD R1, R2, R3. This instruction adds the value in Register R1 with the value in Register R2, and stores the result in Register R3. What is the maximum number of physical memory accesses that may be caused by this single instruction?
a) 1
b) 2
c) 3
d) 4
Answer:
C = 3
Explanation:
The maximum number of physical memory accesses that may be caused by this single instruction is ; 3
This is because In the case of loading two values into R2 and R3 there is need for their memories to be accessed and after execution R1 value there will be a write back into memory hence another memory is also accessed and that makes the number of Physical memories accessed to be three(3) in Total
Ask the user how many numbers for which they want to calculate the sum. Using a for loop, prompt the user to enter that many numbers, one-by-one, keeping track of the sum. At the end, after the user entered all numbers, output the sum.
n = int(input("How many numbers do you want to sum? "))
total = 0
for x in range(n):
total += int(input("Enter a number: "))
print("Sum: "+str(total))
I hope this helps!
Following are the program to the given question:
Program Explanation:
Defining a variable "Sum" that holds an integer value.In the next step, a variable "t" is defined that uses the input method to input a value from the user-end.After the input value, a for loop is declared that takes the range of the t variable.Inside the loop, another variable "n" is defined that inputs value from user-end and use the "Sum" variable to add its value.Outside the loop, a print method has been used that prints the sum variable in the string with the message.Program:
Sum = 0#defining a variable sum that hold an integer value
t= int(input("Enter the total number you want to add: "))#defining a t variable that input value from user-end
for i in range(t):#defining a loop that add inputs values from above user-input range
n= int(input("Enter value "+str(i+1)+": "))#defining loop that inputs n value
Sum += n; #defining sum variable that adds user-input value
print("Sum of entered number: "+str(Sum))#using print method that print added value
Output:
Please find the attached file.
Learn more:
brainly.com/question/16025032
References inserted initially as footnotes can be converted to endnotes through an option in the software.
A. True
B. False
The answer is: A) True
Write an expression that will print "in high school" if the value of user_grade is between 9 and 12 (inclusive).
In python:
if 8 < user_grade < 13:
print("in high school")
You would just need to supply the value of the user_grade variable.
explain mechanical computer ,electromechanical and electronic computer with example
Answer:
A mechanical computer uses moving parts to do it’s calculations. Think old style adding machines.Electronic computers use electronic oscillators to generate a clock. The oscillator might include a mechanical element such as a crystal, but the majority of the clock signal is processed in the electrical domain.
Explanation:
An example of a mechanical computer clock is a Swiss watch movement, which needs no electronics. Movement is based upon springs coupled to other mechanical pieces. Swiss watches are high precision mechanical computers that do counting. There are other types of more sophisticated mechanical computers. Research the works of Konrad Zuse and his Z1 mechanical computer.
What is the best prediction she could make about this
semester's text?
Natalia's class read Shakespeare's Romeo and Juliet
last semester and took a field trip to see it performed
live in a community theater. Today, Natalia learned that
her class will read another work by Shakespeare this
semester
It is a play.
It is an adventure.
It is a fairy tale.
It is a fable.
Answer:its a play
Explanation:
Answer:
A. It is a play
Explanation:
Got the answer correct on the quiz
Write an expression that will print "in high school" if the value of user_grade is between 9 and 12 (inclusive).
Answer:
C#
if(user_grade >=9 && user_grade <=12)
{
Console.WriteLine("In Highschool");
}
Python
if user_grade >= 9 & user_grade <= 12:
print("In Highschool")
Java
if(user_grade >=9 && user_grade <=12)
{
System.println("In Highschool");
}
Explanation:
What was that show where lowe’s were based off eye colors and the main character had orange eyes that let her mind control people. It was either on netflix or hulu
Answer:Raising Dion?
Explanation:
Was it Raising Dion?
what program we write for nested if in c++ to print something after else part but before inner if else
if(condition){
}
else
//something we want to print
if(condition){
}
else{
}
Answer:
if(condition){
}
else {
// something we want to print
if(condition) {
// ...
}
else {
// ...
}
}
Explanation:
Create code blocks using curly braces { ... }.
Use proper indentation to visibly make it clear where code blocks start and end.
What term refers to a sequence of statements in a language that both humans and computers can understand?
a
hexadecimal
b
program
c
binary
d
macro
Answer your answer is Macro
Explanation:
Macro shares language both the computer and the programmer can undestand.
A flashlight bulb uses 2.4 W of power when the current in the bulb is 0.8 A. What is the voltage difference?
Answer:
3 Volts.
Explanation:
Answer:
3 Volts
Explanation:
Because Power = Voltage x Current, so if you substitute the values into the equation, it would be :
2.4 W = Voltage x 0.8 A
Then if you rearrange the equation, it would be :
2.4 W / 0.8 A = Voltage
Which is :
3 V = Voltage
Write a loop that sets newScores to oldScores shifted once left, with element 0 copied to the end. Ex: If oldScores
Answer:
Explanation:
The following is written in Java. It is a method/function that takes the oldScore as an int input. It turns it into a String, separates all the digits, puts them into an array. Then adds the first digit to the end and removes it from the beginning, thus shifting the entire score one to the left. Then it turns the String variable back into an Integer called finalScore and prints it out.
public static void newScore(int oldScore) {
ArrayList<Integer> newScore = new ArrayList<>();
String stringOldScore = String.valueOf(oldScore);
for (int x = 0; x < stringOldScore.length(); x++) {
newScore.add(Integer.parseInt(String.valueOf(stringOldScore.charAt(x))));
}
newScore.add(newScore.get(0));
newScore.remove(0);
String newScoreString = "";
for (int x:newScore) {
newScoreString += String.valueOf(x);
}
int finalScore = Integer.parseInt(newScoreString);
System.out.println(finalScore);
}
The designer of an agent traveled to a beach for a holiday. He took the agent to the beach. He wanted the agent to capture the sunrise and the high tide. What kind of knowledge representation will the agent use in this new environment?
A.
picture
B.
number
C.
graph
D.
meta
Answer:
Picture
Explanation:
describe at least five ways in which information technology can help studying subjects other than computing
Answer:
I'd that IT can help in a great many different fields like
Mathematics, in a manner of solving complex math equations
Statistics, in a manner of creating complex graphs with millions of points
Modeling, in a manner of creating models from scratch, either for cars, personal projects or characters for video games and entertainment
Advertising, in a manner of using IT to create not only the advertisements themselves but also, spreading that advertisement to millions in a single click
Music/Audio, in a manner of creating new sounds and music that wouldn't be able to work in any practical manner
Explanation:
Which software programs should students avoid using to create and submit course work? (Choose all that apply). Word, Pages, Numbers, Keynote
Answer:
tyafana
Explan
ation:n umbers
Write a function named power that accepts two parameters containing integer values (x and n, in that order) and recursively calculates and returns the value of x to the nth power.
Answer:
Following are the code to the given question:
int power(int x, int n)//defining a method power that accepts two integer parameters
{
if (n == 0)//defining if block to check n equal to 0
{
return 1; //return value 1
}
else//defining else block
{
x = x * power(x, --n); //use x variable to call method recursively
}
return x; //return x value
}
Explanation:
In the above-given code, a method power is defined that accepts two integer variable in its parameter, in the method a conditional statement is used which can be defined as follows:
In the if block, it checks "n" value, which is equal to 0. if the condition is true it will return value 1.In the else block, an integer variable x is defined that calls the method recursively and return x value.what is the CPU's role?
Answer:
The CPU performs basic arithmetic, logic, controlling, and input/output (I/O) operations specified by the instructions in the program. The computer industry used the term "central processing unit" as early as 1955.
Answer:
The Cpu is like the brain of the computer it's responsible for everything from running a program to solving a complex math equation.
server.
10. The Domain Name refers to the
a) Mail
b) Google
c) Internet
d) Local
Answer:
C.
Explanation:
The coding system that has just two characters is called:
a
binary
b
dual.
c
basic.
d
double.
Answer:
A. Binary
Definition:
Pertaining to a number system that has just two unique digits 0 and 1. - binary code
Answer:
a binary
Explanation:
ascii. an agreed method for paring the alpanumeric characther set with binary repersenations used in computers. binary. Pertaining to a number system that has just two unique digits 0 and 1. binary code.
Which of the following emergencies are weather-related? A. Ice storm B. Hurricane C. Earthquake D. A and B
Answer:
The answer is D. A and B
Explanation:
I think the answer is D because Ice storms are caused by freezing rain and Hurricanes are formed near the equator over warm ocean waters. both of them are weather-related.
Answer: The answer is D. A and B
Explanation: I took this test 5 mins ago and it was right.
Shelly recorded an audio composition for her presentation. Arrange the following steps that Shelly followed in the proper order.
She added effects to her audio composition.
She saved her audio composition on an optical drive.
She connected her microphone to her computer.
She saved the audio composition in an appropriate file format.
She selected the record option in her DAW.
Answer:
The answer to this question is given below in the explanation section.
Explanation:
Shelly recorded an audio composition for her presentation. She needs to follow the following proper orders to get composition done for her presentation.
She connected her microphone to her computer.She selected the record option in her DAW.She added effects to her audio composition.She saved the audio composition in an appropriate file format.She saved her audio composition on an optical drive.Answer:
She connected her microphone to her computer.
She selected the record option in her DAW.
She added effects to her audio composition.
She saved the audio composition in an appropriate file format.
She saved her audio composition on an optical drive.
describe PROM, EPROM and EEPROM memories
Answer:
Explanation:
PROM is a Read Only Memory (ROM) that can be modified only once by a user while EPROM is a programmable ROM that can be erased and reused. EEPROM, on the other hand, is a user-modifiable ROM that can be erased and reprogrammed repeatedly through a normal electrical voltage.