Assignment_3
Assignment_3
Task 1
Write a function which returns the maximum, ascending and descending of three number
function processNumbers() {
const a = parseFloat(prompt("Enter the first number:"));
const b = parseFloat(prompt("Enter the second number:"));
const c = parseFloat(prompt("Enter the third number:"));
console.log(`Maximum: ${max}`);
console.log(`Ascending order: ${ascending.join(", ")}`);
console.log(`Descending order: ${descending.join(", ")}`);
}
processNumbers();
Task 2
Write a function which checks number till given input/parameter is odd or even
function checkOddEven(limit) {
if (isNaN(limit) || limit < 1) {
console.log("Please enter a valid positive number.");
return;
}
Write a JavaScript program to solve quadratic equation in the form ax2 + bx + c, (Only the
values of a, b and c are provided) the task is to find the roots of the equation.
function solveQuadratic() {
const a = parseFloat(prompt("Enter the value of a:"));
const b = parseFloat(prompt("Enter the value of b:"));
const c = parseFloat(prompt("Enter the value of c:"));
If Driver gets more than 10 penalty points ie. above the speed limit 120, print => 'License
Suspended'
function checkSpeed(speed) {
const speedLimit = 70;
const kmPerPoint = 5;
checkSpeed(65);
checkSpeed(80);