CreditCard
Submit solution
Points:
10
Time limit:
5.0s
Memory limit:
256M
Author:
Problem type
Allowed languages
C#, Go, Java, Python
Crea la classe CreditCard
.
import java.util.Scanner;
// escriu aqui el codi
public class Solution {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
CreditCard creditCard = new CreditCard();
creditCard.holderName = scanner.nextLine();
creditCard.cardNumber = scanner.nextLong();
creditCard.accountBalance = scanner.nextFloat();
creditCard.spendingLimit = scanner.nextFloat();
System.out.println(creditCard.holderName.toUpperCase());
System.out.println(String.valueOf(creditCard.cardNumber).replaceAll(".{4}","$0 "));
System.out.println("Saldo: " + creditCard.accountBalance);
System.out.println("Limit: " + creditCard.spendingLimit);
}
}
Input Format
-
Constraints
-
Output Format
-
Sample Input 0
Lola Mento
1234567812345678
2000.5
300
Sample Output 0
LOLA MENTO
1234 5678 1234 5678
Saldo: 2000.5
Limit: 300.0
Sample Input 1
Elena Nito
9876543219876543
0
1000000
Sample Output 1
ELENA NITO
9876 5432 1987 6543
Saldo: 0.0
Limit: 1000000.0
Sample Input 2
Penelope Luda
1234567891234567
9999999
0.9
Sample Output 2
PENELOPE LUDA
1234 5678 9123 4567
Saldo: 9999999.0
Limit: 0.9
Autoria: Gerard Falcó
CC BY-NC-SA 4.0