Unilorin C Programming Question. - Programming - Nairaland
Nairaland Forum › Science/Technology › Programming › Unilorin C Programming Question. (1559 Views)
| Unilorin C Programming Question. by GrAnDwEeZ(op): 8:11am On May 26, 2015 |
In a certain research laboratory, some yttrium-90 has leaked into the computer analysts's coffee room. The leak will presently expose personnel to 80millirems of radiation a day. The half life of the substance is about 5days; I.e the radiation level is only half of what it was five days ago. The analyst wants to know how long it will be before the radiation is down to a safe level of 0.855millirem a day. Write a program in c that will create a chart that displays the radiation level for every five days with the message unsafe or safe accordingly. The chart should stop before the radiation level is one-tenth of the safe level, because the analyst requires a safety factor of 10. The program should prompt the user to enter the initial radiation level.
|
| Re: Unilorin C Programming Question. by Ogbeozioma: 10:58am On May 26, 2015 |
Long question, simple question... What do u want us to do with the question? Make we dey praise u say ur school hard? Just joking sha |
| Re: Unilorin C Programming Question. by Craigston: 2:26pm On May 26, 2015 |
Brb although I don't know C. This problem is interesting. |
| Re: Unilorin C Programming Question. by Nobody: 4:21am On May 29, 2015*. Modified: 5:39pm On May 29, 2015 |
Its a very simple questions, u just got scared by d size.. _______ - printf("enter initial radiation level" ;float rad, tmprad; int days=0; scanf("%f", &rad); tmprad = rad; //to avoid false positive in the while condition float tok = 0.855 ,safelevel = (1/10) * tok; // one-tenth the safe level while(tmprad > safelevel){ if(tmprad/2 > safelevel)//forward checking { printf("current radiation level is %f, safe level of %f will be achieved in %d days time", tmprad, tmprad/2, days+5); break; } printf("at day %d, radiation level is %f => unsafe!\n", days, tmprad); tmprad = tmprad/2; days += 5; } ----- ____________ |
| Re: Unilorin C Programming Question. by olyjosh(m): 8:51pm On May 29, 2015 |
Quite simple, NO BIG DEAL, Stop the hype, its what you have been taught |
| Re: Unilorin C Programming Question. by GrAnDwEeZ(op): 9:59pm On May 29, 2015*. Modified: 4:18am On May 30, 2015 |
Not trying to hype . Though we've been taught some basics. Buh dis waz kinda tricky... Jez seeking solution here datz all. |
| Re: Unilorin C Programming Question. by jacob05(m): 10:11pm On May 29, 2015 |
after working on @mobolaji88 code
|
| Re: Unilorin C Programming Question. by laykhorn(m): 8:19am On Jun 01, 2015 |
jacob05:I think we have a correct answer! You should allign your code well, its difficult to parse |
Learn C++ Programming Language In Few Days • C Programming Help • I Want To Learn C++ Programming Language • 2 • 3 • 4
Create A Sec,ure • What Mechanisms Does Ios Provide To Support Multi-threading? • Need Help On My Project
;