Practice Program 1:
Create a Project named WebSiteStats that will contain two classes: WebSiteStats and WebSiteClient.
WebSiteStats class:
Instance Variables:
• An integer that keeps a count of number of visitors
• A string that represents the type of website: government, commercial, university, military
Methods:
• Getters for both instance variables
• setVisitors- sets the number of visitors, as long as the value is not less than zero
• setType- sets the type, only if it is one of the four types: government, commercial, university, military. Otherwise, the type is set to “unknown”.
• toString- set output of the stats in this format: type: commercial; visitors: 45009
WebSiteClient class:
• Create an instance of WebSiteStats that receives 12804 as the number of visitors and “government” as the type.
• Create an instance of WebSiteStats that receives 45009 as the number of visitors and “commercial” as the type.
• Write the code to get the following output:
The visitors of web site stats #1 is 12804
The type of web site stats #1 is government
Web Site Stats #2 is type: commercial; visitors: 45009
Hi. You have a simple project that I can do for you for a small budget and in less than an hour. Message me if you are interested so I can start with work.
$15 USD en 1 día
5,0 (40 comentarios)
5,0
5,0
5 freelancers están ofertando un promedio de $38 USD por este trabajo
Hi, nice to meet you, i can deliver a solution for your java program, tell me if you need tell me details in private chat, if the project is easiest we can consider the price
Hi there,
I can help you out with the task. You need this in Java language?
let me know when you're available so we may discuss it in detail.
Thanks,
Shoaib
I have successfully delivered many projects in many different company and clients. I have a strong Programming and Management skills and always updates myself with Research and Development of new technologies to strengthen my knowledge and skills.