Uploaded March 2025 | Updated September 2026, 1 week ago
#coding #programming #cprogramming
// WEIGHT CONVERTER PROGRAM
int choice = 0;
float pounds = 0.0f;
float kilograms = 0.0f;
printf("Weight Conversion Calculator\n");
printf("1. Kilograms to Pounds\n");
printf("2. Pounds to Kilograms\n");
printf("Enter your choice (1 or 2): ");
scanf("%d", &choice);
if(choice == 1){
// Kilograms to Pounds
printf("Enter the weight in kilograms: ");
scanf("%f", &kilograms);
pounds = kilograms * 2.20462;
printf("%.2f kilograms is equal to %.2f pounds\n", kilograms, pounds);
}
else if(choice == 2){
// Pounds to Kilograms
printf("Enter the weight in pounds: ");
scanf("%f", £s);
kilograms = pounds / 2.20462;
printf("%.2f pounds is equal to %.2f kilograms\n", pounds, kilograms);
}
else{
printf("Invalid choice! Please enter 1 or 2\n");
}
return 0;
#coding #programming #cprogramming
// WEIGHT CONVERTER PROGRAM
int choice = 0;
float pounds = 0.0f;
float kilograms = 0.0f;
printf("Weight Conversion Calculator\n");
printf("1. Kilograms to Pounds\n");
printf("2. Pounds to Kilograms\n");
printf("Enter your choice (1 or 2): ");
scanf("%d", &choice);
if(choice == 1){
// Kilograms to Pounds
printf("Enter the weight in kilograms: ");
scanf("%f", &kilograms);
pounds = kilograms * 2.20462;
printf("%.2f kilograms is equal to %.2f pounds\n", kilograms, pounds);
}
else if(choice == 2){
// Pounds to Kilograms
printf("Enter the weight in pounds: ");
scanf("%f", £s);
kilograms = pounds / 2.20462;
printf("%.2f pounds is equal to %.2f kilograms\n", pounds, kilograms);
}
else{
printf("Invalid choice! Please enter 1 or 2\n");
}
return 0;



![Java printf() is really useful! 🖨️
#java #javatutorial #javacourse
public class Main {
public static void main(String[] args) {
// printf() is a method used to format output
// % [flags] [width] [.precision] [specifier-character]
// [specifier-character]
String name = Spongebob;
char firstLetter = S;
int age = 30;
double height = 60.5;
boolean isEmployed = true;
System.out.printf(Hello %sn, name);
System.out.printf(Your name starts with a %cn, firstLetter);
System.out.printf(You are %d years oldn, age);
System.out.printf(You are %f inches talln, height);
System.out.printf(Employed: %bn, isEmployed);
System.out.printf(%s is %d years old, name, age);
// [.precision]
double price1 = 9.99;
double price2 = 100.15;
double price3 = -54.01;
System.out.printf(%.3fn, price1);
System.out.printf(%.3fn, price2);
System.out.printf(%.3fn, price3);
// [flags]
// + = output a plus
// , = comma grouping separator
// ( = negative numbers are enclosed in ()
// space = display a minus if negative, space if positive
System.out.printf(%fn, price1);
System.out.printf(%fn, price2);
System.out.printf(%fn, price3);
// [width]
// 0 = zero padding
// number = right justified padding
// negative number = left justified padding
int id1 = 1;
int id2 = 23;
int id3 = 456;
int id4 = 7890;
System.out.printf(id: %04dn, id1);
System.out.printf(id: %04dn, id2);
System.out.printf(id: %04dn, id3);
System.out.printf(id: %04dn, id4);
}
} Java printf() is really useful! 🖨️](https://i.ytimg.com/vi/nTBDjxWAcoE/mqdefault.jpg)

![Learn Java overloaded methods in 6 minutes! 🍕
#java #javatutorial #javacourse
public class Main {
public static void main(String[] args){
// overloaded methods = methods that share the same name,
// but different parameters
// signature = name + parameters
String pizza = bakePizza(flat-bread, mozzarella, pepperoni);
System.out.println(pizza);
}
static String bakePizza(String bread){
return bread + pizza;
}
static String bakePizza(String bread, String cheese){
return cheese + + bread + pizza;
}
static String bakePizza(String bread, String cheese, String topping){
return topping + + cheese + + bread + pizza;
}
} Learn Java overloaded methods in 6 minutes! 🍕](https://i.ytimg.com/vi/nhnAx79gxCM/mqdefault.jpg)
![The Java Math class + exercises! 📐
#java #javatutorial #javacourse
00:00:00 intro
00:00:10 constants
00:00:57 methods
00:04:24 exercise1
00:08:27 exercise2
00:13:25 printf
public class Main {
public static void main(String[] args) {
System.out.println(Math.PI);
System.out.println(Math.E);
double result;
result = Math.pow(3, 4);
result = Math.abs(-5);
result = Math.sqrt(16);
result = Math.round(3.14);
result = Math.ceil(3.14);
result = Math.floor(3.14);
result = Math.max(10, 20);
result = Math.min(10, 20);
System.out.println(result);
}
}
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
double a;
double b;
double c;
System.out.print(Enter the length of side A: );
a = scanner.nextDouble();
System.out.print(Enter the length of side B: );
b = scanner.nextDouble();
c = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2));
System.out.println(The hypotenuse is: + c + cm);
scanner.close();
}
}
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
// circumference = 2 * Math.PI * radius;
// area = Math.PI * Math.pow(radius, 2);
// volume = (4.0 / 3.0) * Math.PI * Math.pow(radius, 3)
Scanner scanner = new Scanner(System.in);
double radius;
double circumference;
double area;
double volume;
System.out.print(Enter the radius: );
radius = scanner.nextDouble();
circumference = 2 * Math.PI * radius;
area = Math.PI * Math.pow(radius, 2);
volume = (4.0 / 3.0) * Math.PI * Math.pow(radius, 3);
System.out.printf(The circumference is: %.1fcmn, circumference);
System.out.printf(The area is: %.1fcm²n, area);
System.out.printf(The volume is: %.1fcm³n, volume);
scanner.close();
}
} The Java Math class + exercises! 📐](https://i.ytimg.com/vi/nle8CQXYhl4/mqdefault.jpg)


![Create QR codes with Python in 4 minutes! 📱
#python #coding #programming
# In a terminal: pip install qrcode[pil]
import qrcode
url = input(Enter the URL: ).strip()
file_path = qrcode.png
qr = qrcode.QRCode()
qr.add_data(url)
img = qr.make_image()
img.save(file_path)
print(QR Code was generated!) Create QR codes with Python in 4 minutes! 📱](https://i.ytimg.com/vi/pJdTyvufOdg/mqdefault.jpg)
