+ 1

Is it possible to print a message in separate line without using two System.out.println() statements?

26th May 2021, 5:05 AM
Aditya Mishra
5 Antworten
0
I think it should be like this System.out.println("Myself aditya " +"\n" +" I am a java coder"); In case it is crct upvote it
26th May 2021, 5:10 AM
Aditya Mishra
- 1
System.out.println("first message \n second message") '\n' means go to the next line!
26th May 2021, 5:08 AM
Alpha Diallo
Alpha Diallo - avatar
- 2
Yeah
26th May 2021, 10:09 PM
هيثم ادم محمد احمد
هيثم ادم محمد احمد - avatar
- 2
plz help me guys (a) Create a class named LivestockProject with fields that hold a membership number, the name of the member, surname, date of birth, gender, location and initial number of livestock (cattle) turned in. Include a constructor that initializes each field to appropriate default values. Also include methods to set and get each of the fields. (b) Create a livestock production estimation method(s) that will calculate and predict livestock production over a certain period of time (1 year, 2 years, 5 years, etc.), considering the following factors: • The percentage of cows in heat in a 21-day period = 90% • The percentage of the heats that are fertile = 90% • The percentage of the cows that are serviced by the bull = 95% • The 2 bulls per 100 cows ratio for a period of 5 years • The percentage of calves born in the herd will be bull = 30% • The gestation length of a bull valves = 287 days • The gestation length of a heifer valves = 279 days • The number of days a cow should undergo involution = 50 days • The number of births a cow can give in its lifetime = 8 • The age that a heifer requires to reach puberty and be bred = 14 months (c) Create a class named PredictProduction whose main() method instantiate an object of the class LivestockProject. Within the method, prompt a user for registration, indicating the name, surname, date of birth, gender, location and initial number of livestock (cattle) to turn in. When a certain number of members have been successfully registered, your application must print the following: • The Database of registered members on the application • Estimated livestock production per member over a certain period of time • Estimated livestock production for the entire project over a certain period of time • Estimated livestock production of bulls and heifers per member over a certain period of time • Estimated livestock production of bulls and heifers for the entire project over a certain period of time
27th May 2021, 12:52 AM
Masithembe Dyosi
Masithembe Dyosi - avatar