012-001-007
Static Variable: Visit Counter
Easy
Problem Description
Static Variable: Visit Counter
Learning Objective: Manage class-wide information with static variable
Create program counting webpage visits. Use static variable to manage total visit count shared across all instances.
Input
Line 1: Visit count (integer)
Output
Visit count: [count] times
Total visitors: [total] people
Test Cases
※ Output examples follow programming industry standards
Input:
5
Expected Output:
Visit count: 5 times Total visitors: 5 people
Input:
10
Expected Output:
Visit count: 10 times Total visitors: 10 people
Input:
1
Expected Output:
Visit count: 1 times Total visitors: 1 people
❌ Some tests failed
Your Solution
Current Mode:● My Code
99
1
2
3
4
5
6
7
8
9
10
›
⌄
⌄
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// Write your code here
sc.close();
}
}
0 B / 5 MB
You have 9 free executions remaining
