Progeek37's Posts
Nairaland Forum › Progeek37's Profile › Progeek37's Posts
1 2 3 4 5 6 7 8 9 10 11 12 13 (of 13 pages)
IamTeen:Nice! |
IamTeen:Good. Can you do this without the pre-knowledge that the sum of the numbers is 10**7? That's the essence of the question, the same thing you did here can be done using Python range but such solution is trivial. |
Let's programmers meet and learn from each through problem solving. Join our WhatsApp Group drop your number to be added. |
Before you start any projects make you have grabbed the fundamentals of programming itself. It will go a long way in helping you. |
Join our WhatsApp Group that makes a difference. Drop your number to be added. |
The WhatsApp Group is bubbling with solution of programming problems. Drop your number to join the movement. |
Drop your number to join our WhatsApp Group |
The WhatsApp Group is still available for new comers. |
Drop your number to Join our WhatsApp Group QUESTION Write a program that converts Roman numerals to Hindu Arabic numerals (0123456789). That's when a user enters a Roman digits like ix or "IX" it should print 9. Visit the internet and download the charts of Roman digit and their corresponding Arabic ones and study the chart. See chart below. NOTE: I = 1 V = 5 X = 10 L = 50 C = 100 D = 500 M = 1000 These 7 numerals must be handled separately. The remaining numerals follow a certain pattern. See whether you can understand the pattern by studying these two patterns and implement an algorithm for that: (1) IX = -1 + 10 = 9 XL = - 10 + 50 = 40 XC = - 10 + 100 = 90 (2) VI = 5 + 1 = 6 XX = 10 + 10 = 20 LX = 50 + 10 = 60
|
MrsQ:You can be a self-taught programmer like me. Perhaps, it works for me because I studied Mathematics in the university. But I don't know whether you have a foundational knowledge of Mathematics. If you don't have it, self-teaching may not work for you because you are likely to get lost at the sight of a simple algorithm and programming problems. If that's the case then you need a tutor or take the said course. Programming is never complete without basic knowledge of Mathematics and logic. You can go ahead and take the course, if you a need a tutor I can help. Consider joining our new WhatsApp group Drop your number here to added. |
progeek37:I'm still waiting to see the solutions to these problems. |
Join our WhatsApp group https:///Kfg0cmZW1hV7kPq656zRC7 |
AdolphBrian:Things seem to be working fine though I can't prove everything with that screenshot alone. Run it and print out certain prefixed-numbers that end with certain 4-digit numbers. |
QUESTION In the beginning, at the birth of computing, there were no programming languages. Programs looked something like this: 001100010000000000000000001100010000000100000001001100110000000100000010010100010000101100000010001000100000001000001000010000110000000100000000010000010000000100000001000100000000001000000000011000100000000000000000 That is a program to add the numbers from 1 to 10 together and print out the result: 1 + 2 + ... + 10 = 55. How tedious could this be? This is difficult to understand and write without errors by human beings, but unfortunately that's the only language computer understands the so-called machine language. A we know Computer understands only 0 and 1 and nothing more. Luckily we now have high level languages that human beings can understand and write without errors and compilers/interpreters that can translate the high level languages to the machine language. As far as computing is concerned the most important things are the two bits: 0 and 1 the so-called binary notation any other things can be converted from from binary notation. (1 ) Write a program that converts a given number from decimal to binary notation. (2) Write a program that converts a given number from binary to decimal notation. (3) Write a program that converts a given number from decimal to hexadecimal notation. (4) Write a program that converts a given number from hexadecimal to decimal notation. (5) Modify question number (2) by: Writing a program that converts a binary number to decimal using the Horner scheme(a.k.a Horner Method ) Search Wikipedia for details on Horner Method. Horner method is fast and code-efficient. This is how Horner scheme works. 1001 (base two) = ((1 × 2 + 0) × 2 + 0) × 2 + 1 = 2 × 2 × 2 + 1 = 9 (base 10) |
Welcome to Coding Ask and Answer! Coding Ask and Answeris a place to learn programming by solving problems. Though you may be guided on difficult algorithm, you must learn to struggle with the problem yourself. Anyone can ask questions and answer questions. If you who successfully tackle any problem do us a favour by sending to the group some screenshots of the sample run and a description of the algorithm used. Here, no one is going to teach you how to develop website or mobile/desktop apps. If need such things consider joining other groups for assistance Coding Ask and Answer is a place for programmers to consult, share ideas, and solve programming problems. Here we solve problems only! Solutions from any language is acceptable since any program can easily be translated into other languages once the algorithm is understood. Drop your number to be added to our WhatsApp group TIPS It is never beneficial to browse the Internet for solutions. It is never advisable because it will render you unproductive and turn you into programming dummy. If you encounter any difficulty in solving programming problems. Browse for How to to do certain things in your programming language in the Internet. Never browse for the Solution itself. If a certain algorithm or method/formula is required, visit Wikipedia to learn more about the algorithm, like the case of Horner Scheme. Once again welcome! |
Sixtytwo62:Perfect! |
Sixtytwo62:I think this is near to perfection. But it is printing 12-digit numbers? Can you screenshot the very beginning of the output? Your coding skill is needed. Have you been added to our WhatsApp group? |
modestbrowser:Wow! This is great. The output looks really appealing. I think I will start studying JavaScript. Please share the source code on the WhatsApp group. |
modestbrowser:Let me check it. |
modestbrowser:Please note that you are there already. I said you should modify your algorithm to be print the whole number. It should be like 0813 000 3431 0813 001 3431 0813 002 3431 ...etc I hope you understand me now. Have you joined our WhatsApp group? |
modestbrowser:Okay. |
modestbrowser:I never intended the problem to be solved on the pre-knowledge that the the total number is 10 000 000. Your program itself should be able show the total number. |
Sixtytwo62:How can one know that such program outputs the correct phone numbers? I mean how many numbers are you going to manually test to verify that the program is printing correct numbers. That's not how I intended the program to display. Check my previous screenshots on how the output should appear. Your phone can display all the numbers that end with "3431" but it cannot display all the result. Please modify the program. |
modestbrowser:There's no valid calculation in the question. I just used 3.00 to show how the output should look like. |
modestbrowser:That's great. I would like to see the screenshots. And remember that GPA and CGPA are never rounded up or down. That's if you have 3.6795 or 4.5437 in your calculation, then CGP must be 3.67 or 4.54 and NOT 3.68 or 4.50 respectively. |
modestbrowser:My brother I'm shocked that some people can lie in ignorance and hypocrisy. I created this thread to help build Nigerian future programmers. Anyone experienced programmer should sacrifice a little time at least once in a while to help build our future programmers here. If such a person is really experienced then it should not take more than few minutes to come up with an algorithm to solve such problem. Programming is not done by an endless I can's and I will's programming is done by actual implementation. |
asalimpo:I really need experienced programmers. Please consider dropping your number here so that I can add you to our WhatsApp group. Thanks |
modestbrowser:Okay. Please after solving it consider sharing the screenshots of the sample run of the program. Thanks |
Sample Question 2 In the Nigerian Federal universities, the grading system is used to calculate the performance of the students. In one particular university the grading system is as follows: Course code: This is the shorthand representation of the course name. For instance, in the university "An Introduction To Calculus" is given the course code MTH121. Credit hour: This is the contact hour or weight assigned to the course, as an example MTH121 is given the credit hour of 4. Workload: Workload is the sum of all the credit hours of the courses offered by the student in a semester. Students are allowed a minimum of 15 units and maximum of 24 units per semester. Letter grade: These are the letters attached to a score bracket. A scores within a particular range is given the same letter grade: For instance the score bracket in % of the university is given as follows: (70-100) = A, (60-69) = B, (50-59) = C, (45-49) = D, (40-44) = E and (1-39) = F. Grade points: These are the point values assigned to eache letter grade. For instance, in the same university the grade points are as follows: A = 5, B = 4, C = 3, D = 2, E = 1 and F = 0. Quality point: The quality point is the product of credit hours and its corresponding grade point. This means multiplying the credit hour by its grade point. In our example, if a student scores 75 (A) in MTH121 the grade point will be 4 * 5 = 20. Grade Point Average(GPA): This is calculated as follows, GPA = Total quality point/total workload for the semester Cumulative Grade Point Average(CGPA): Mathematically, this is expressed as CGPA = (First semester GPA + Second semester GPA) / 2. If you are still confused about grading system, browse the internet for details. Note: the grading system may vary in different universities, but the algorithm for calculating GPA (grade point average) and CGPA (cumulative grade point average) remains the same. Write a program that can calculate the GPA of any semester and the CGPA of the session, your program should be able to allow one to write the result to file and read result from file as well. You may consider making the output visually appealing by using string methods. For instance the output may appear like this: MTH121----------------------A PHY121---------------------- B CHM121-------------------- D . . . GPA ------------------------3.00 |
hitan:I have added you. |
asalimpo:Okay! When you are less busy consider writing the codes and check if everything works fine. Initially, I thought the problem was trivial but as I began to approach it, I later found out that it was not that trivial. That is the reason I'm emphasizing on writing the code to get the feel of it yourself. |
As improbable as it might seem to you, the basic principles of writing computer programs have not changed all that much in the past 15 years. Programming languages change, technologies get modernized, integrated development environments get more and more advanced but the fundamental principles of programming remain the same. When beginners learn to think algorithmically, and then learn to divide a problem instinctively into a series of steps to solve it, as well as when they learn to select the appropriate data structures and write high-quality programming code that is when they become programmers. Once you acquire these skills, you can easily learn new languages and various technologies. |