6.4.. Napisati program koji za učitano x ispisuje vrijednost y po formuli:
a) y = kx + b

Opis rješenja:

Opis programa:

Listing programa:

package zadatak;
import java.util.Scanner;
public class P06411132 {
    public static void main(String[] args)	{
    Scanner input = new Scanner (System.in);
	
	System.out.print("Unesi x: ");
	double x=input.nextDouble();
	System.out.print("Unesi b: ");
	double b=input.nextDouble();
	System.out.print("Unesi k: ");
	double k=input.nextDouble();
	double y;

	y = k*x+b;

	System.out.println("y="+(y));
}}

Ispis na ekranu:

Index