-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathQuadraticRoots.ctxt
6 lines (6 loc) · 1.66 KB
/
QuadraticRoots.ctxt
1
2
3
4
5
6
#BlueJ class context
comment0.target=QuadraticRoots
comment0.text=\r\n\ Name\:\ Bill\ Mao\r\n\ Date\:\ 9/20/17\r\n\ School\:\ East\ Chapel\ Hill\ High\ School\r\n\ Program\:\ Program\ 54h\ (roots)\r\n\ Description\:\ This\ program\ is\ designed\ to\ the\ take\ coefficients\ of\ a\ standard\ quadratic\ equation,\ and\ calculate\ its\ roots.\r\n\ It\ first\ imports\ classes\ required\ for\ keyboard\ input,\ and\ then\ initializes\ the\ Scanner\ object\ that\ allows\ for\ keyboard\ input.\r\n\ It\ then\ asks\ the\ user\ to\ type\ in\ the\ three\ coefficients\ for\ the\ quadratic\ equations.\r\n\ The\ coefficients\ are\ then\ stored\ separately\ as\ doubles,\ and\ the\ square\ root\ of\ the\ discriminant\ is\ found\ first.\r\n\ The\ program\ then\ plus\ in\ the\ square\ root\ of\ the\ discriminant\ into\ the\ full\ equation\ to\ find\ the\ two\ roots,\ and\ then\ stores\ them\ as\ doubles.\r\n\ The\ program\ finally\ prints\ out\ the\ roots\ of\ the\ equation.\ The\ values\ are\ not\ rounded\ as\ the\ user\ may\ want\ to\ chose\ the\ level\ of\ precision.\r\n\ Difficulties\:\ When\ I\ created\ this\ program,\ I\ originally\ intended\ to\ do\ the\ quadratic\ equation\ in\ one\ go,...\r\n\ but\ I\ split\ the\ calculation\ of\ the\ discriminant\ and\ the\ root.\r\n\ This\ was\ done\ in\ order\ to\ reduce\ the\ amount\ of\ parentheses\ in\ one\ line\ of\ code\ and\ to\ improve\ readability.\r\n\ What\ I\ Learned\:\ In\ this\ exercise,\ I\ learned\ how\ to\ import\ classes\ and\ create\ objects.\r\n\ I\ also\ learned\ how\ to\ store\ input\ from\ the\ keyboard,\ and\ use\ the\ Math\ class.\r\n
comment1.params=args
comment1.target=void\ main(java.lang.String[])
numComments=2