Answer:
import java.util.Scanner;
import java.lang.*;
class Main
{
public static void main(String args[])
{
int n;
//For capturing the value of n
Scanner scanner = new Scanner(System.in);
System.out.println("Enter the value of n:");
//The entered value is stored in the var n
n = scanner.nextInt();
int k=1;
printnum(n,k);
}
public static void printnum(int n,int k)
{
if(n%2==0)
{
for(int i=k;i<=n-1;i=i+2)
{
System.out.print(i);
}
System.out.println("");
}
else
{
for(int i=k;i<=n-1;i=i+2)
{
System.out.print(i);
}
System.out.println("");
}
n--;
if(n<=1)
{
System.exit(0);
}
else
{
printnum(n,k+1);
}
}
}
Explanation:
The program is self explanatory.
A Python program that can convert a Fahrenheit temperature to Celsius, or vice versa. The program should use two custom functions, f_to_c and c_to_f, to perform the conversions.
Explanation:
- Functions should be defined in a custom module named temps. Custom function c_to_f should be a void function defined to take a Celsius temperature as a parameter.
- It should calculate and print the equivalent Fahrenheit temperature accurate to three decimal places.
- Custom function f_to_c should be a value-returning function defined to take a Fahrenheit temperature as a parameter.
- This function should calculate the equivalent Celsius temperature and return it.
The code is given below :
def c_to_f(tempCelsius):
tempFahrenheit = ((9/5)*tempCelsius) + 32;
print("\n %.3f Celsius is %.3f Fahrenheit \n" %(tempCelsius, tempFahrenheit));
def f_to_c(tempFahrenheit):
tempCelsius = (tempFahrenheit - 32) * (5/9);
return tempCelsius;
(Import modules)
import temps;
def main():
temperature = float(input("\n Enter a temperature: "));
scale = input("\n Was that input Fahrenheit or Celsius c/f? ");
if scale.lower() == 'c':
temps.c_to_f(temperature);
else:
tempCel = temps.f_to_c(temperature);
print("\n %.1f Fahrenheit equals %.3f Celsius \n" %(temperature, tempCel));
main();
1. Horsing around can lead to breaking equipment in the classroom or somebody getting hurt
2. leaving your backpack on the floor can cause someone to fall
3.something unexpected may happen and worsen the problem
4. it can corrupt the computer's files and deleted unsaved work.
if you want the sentences to be longer, add some words to them and make the message the same.
Answer:Having Microsoft Office training can make you more productive, confident, and satisfied with your job. ... Productivity is crucial to success in the administrative assisting field, and your employers will thank you for it. 3. Industry-recognized certification will boost your resume and increase your earning potential.
Explanation: i no it
Answer:
import <em>csv</em>
fileIn = open("data/bags.txt","r")
countPurse = 0
Explanation:
Edge 2021