Writing a Program to Divide Numbers - Help Needed

AI Thread Summary
A program is being developed to input a number and divide it by a list of numbers, returning the integer results with remainders. The programmer is using C++ and has successfully created a basic version but faces two main challenges: resetting the program with a button press instead of restarting it and handling integer values beyond 250,000, which currently result in garbled data. Recommendations include consulting a C++ manual to understand the language better and focusing on specific functions needed for the project, as this will facilitate a quicker resolution to the issues encountered.
carterw
Messages
5
Reaction score
0
Hello.

I would like to write a program into which I can input any number, say 11133, and divide this by a list of numbers, say 543, 345, 2368...
and have the program print the list of results, integers only, with the remainder.

I imagine this is a fairly simple program to write, but I am still unfamiliar as yet with what steps to take to begin. Would anyone be able to help. Thanks in advance.

Dan
 
Computer science news on Phys.org
First, select a language.

- Warren
 
Hi Warren,

Thanks,
I have started using a '94 version of C++,
are you familiar with this?
I managed to get a useful program working.

Two problems though that I have not been able to find solutions to yet.

1) How do i get it so the program resets at the press of a button so I don't have to keep exiting and entering again?

2) Even though I am using "long" integers throughout, the program will not print values better than about 250 000. beyond this I just get garbled data.

Thanks,
Dan
 
carterw,

If C++ is your language of choice and you don't have a manual explaining the coding requirements, then I would recommend that you do that first. You don't have to read the book from cover to cover, but, understand the overall methodology of the language and focus on the sections that address the specific functions you need. Anytime spent learning a language such as an all purpose tool like C++, is time well spent.

You are right. Once you review the manual, this job should take only a few minutes to complete.
 
Last edited:
Thread 'Urgent: Physically repair - or bypass - power button on Asus laptop'
Asus Vivobook S14 flip. The power button is wrecked. Unable to turn it on AT ALL. We can get into how and why it got wrecked later, but suffice to say a kitchen knife was involved: These buttons do want to NOT come off, not like other lappies, where they can snap in and out. And they sure don't go back on. So, in the absence of a longer-term solution that might involve a replacement, is there any way I can activate the power button, like with a paperclip or wire or something? It looks...
In my discussions elsewhere, I've noticed a lot of disagreement regarding AI. A question that comes up is, "Is AI hype?" Unfortunately, when this question is asked, the one asking, as far as I can tell, may mean one of three things which can lead to lots of confusion. I'll list them out now for clarity. 1. Can AI do everything a human can do and how close are we to that? 2. Are corporations and governments using the promise of AI to gain more power for themselves? 3. Are AI and transhumans...

Similar threads

Back
Top