Answer:
Following are the method definition to this question:
public String notice_bill(double amount) //defining method
{
return this.name+", account number "+this.currAccNum+", please pay $"+amt; //return value.
}
Explanation:
In the given question some information is missing, that is example So, method definition to this question can be described as follows:
- In the above method definition a string method "notice_bill" is declared, which accepts a double value in its parameter, that is "amount".
- Inside the method, this keyword is used, that hold values and return its value as a message.
Answer:
Please check options are not given. Please check explanation for corrected version.
Explanation:
Options are not mentioned. Please post the complete question.
However, if "below" is removed, the question makes sense. I am taking it that way.
Dichotomous question means those questions which has two outcomes: true or false.
For the given condition, this is possible only if:
- coin shows head and dice shows 1
- coin shows head and dice shows 2
- head, 3
- head, 4
- head, 5
- head, 6
- tails, and all above cases
However, each time, each mentioned condition should be strictly followed.
And fewer outcome than 1 is virtually or realistically impossible, as both coin and dice will roll out one outcome in any condition certainly.
Answer:
The answer is "A blank line".
Explanation:
The blank line initiates the interpreter to start examining the line of statements whenever the Python shell as well as the code block are used.
- It is also known as the line that has nothing but spaces or lines without texts or a line.
- It prints an empty sheet, which leaves its performance with such a blank line.
Answer:
The solution code is written in Python 3 as below:
- outfile = open("greeting.txt", "w")
- outfile.write("Hello World")
- outfile.close()
Explanation:
To create a simple text file in Python, we can use Python built-in function, <em>open()</em>. There are two parameters needed for the open() function,
- the file name and
- a single keyword "w". "w" denote "write". This keyword will tell our program to create a file if the file doesn't exist.
The statement <em>open("greeting.txt", "w")</em> will create a text file named "<em>greeting.txt</em>" (Line 1)
To fill up the content in the greeting.txt, we use <em>write()</em> method. Just include the content string as the argument of the <em>write()</em> method. (Line 2)
At last, we use <em>close() </em>method to close the opened file,<em> outfile</em>. This will release the system resource from the<em> outfile.</em>
Answer:
Pseudo CODE
a)
n= Input “Enter 5 integer value”
b)
sum=0.0
For loop with i ranging from 0 - 5
Inside loop sum=n[i]+sum
Outside loop avg= sum/5
Print avg
c)
small=n[0] # assume the first number in the list is smallest
large= n[0] # assume the first number in the list is largest
For loop with i ranging from 0 - 5
Inside loop if n[i]<small #if any another number is smaller than small(variable)
Inside if Then small=n[i]
Inside loop if n[i]>large # if any another number is larger than large(variable)
Inside if then large=n[i]
Print small
Print large
d)
print avg
print small
print large