User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Pascal and Delphi section within the Software Development category of DaniWeb, a massive community of 402,369 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,062 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Pascal and Delphi advertiser: Programming Forums
Views: 2042 | Replies: 13
Reply
Join Date: Mar 2007
Posts: 17
Reputation: chickenmcnugget is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
chickenmcnugget's Avatar
chickenmcnugget chickenmcnugget is offline Offline
Newbie Poster

Help !!! Help ME !!!!!

  #1  
Mar 27th, 2007
ok so im in college right computer science major first year and all and they still have pascal can you believe it wow so ne ways he gives out this assingment and the assingment is this i need to write a programm using delphi ythat would be able to name a prime number or a non prime number from 1 to 1000 and it needs to open the window when ran to ask you for a number and you enter a number press enter then it needs to decifer if it is a prime number or a non prime number i need help ANYONE PLEASE HELP!!!!
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2007
Posts: 17
Reputation: chickenmcnugget is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
chickenmcnugget's Avatar
chickenmcnugget chickenmcnugget is offline Offline
Newbie Poster

Re: !!! Help ME !!!!!

  #2  
Mar 27th, 2007
ok so i got some of it done i need help on the function part sooooo i find that to be the hardest ne one with ne suggestions or or ne thing
Reply With Quote  
Join Date: Dec 2006
Location: Romania
Posts: 171
Reputation: radu84 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 16
radu84 radu84 is offline Offline
Junior Poster

Re: !!! Help ME !!!!!

  #3  
Mar 28th, 2007
so, you think that pascal is old fashion, and you want to use delphi(you got charmed probably about drag-drop,click and the program is finished) but you aren't able to find if a number is prime or not?

what you have done until now? post some code of what you accomplished and we'll help you.

best regards,
Reply With Quote  
Join Date: Mar 2007
Posts: 17
Reputation: chickenmcnugget is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
chickenmcnugget's Avatar
chickenmcnugget chickenmcnugget is offline Offline
Newbie Poster

Re: !!! Help ME !!!!!

  #4  
Mar 28th, 2007
ok so you want me to put up some code to show i know it and not just copping out or something is wut your getting out and its not that i need to know what a prime number is or if it is prime it is having the program tell me its prime .....
Reply With Quote  
Join Date: Mar 2007
Posts: 17
Reputation: chickenmcnugget is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
chickenmcnugget's Avatar
chickenmcnugget chickenmcnugget is offline Offline
Newbie Poster

Re: !!! Help ME !!!!!

  #5  
Mar 28th, 2007
heres some code actually a program run it and tell me wut u think
Reply With Quote  
Join Date: Mar 2007
Posts: 17
Reputation: chickenmcnugget is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
chickenmcnugget's Avatar
chickenmcnugget chickenmcnugget is offline Offline
Newbie Poster

Re: !!! Help ME !!!!!

  #6  
Mar 28th, 2007
heres guys heres my code you guys wanted i just need help with this oother program and actually my whole class is stumped and thats why im here im lost on this im looking for help not for you guys to do it ya and thanx
Attached Files
File Type: txt program heres your picnic.txt (5.0 KB, 4 views)
Reply With Quote  
Join Date: Mar 2007
Posts: 17
Reputation: chickenmcnugget is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
chickenmcnugget's Avatar
chickenmcnugget chickenmcnugget is offline Offline
Newbie Poster

Re: !!! Help ME !!!!!

  #7  
Mar 28th, 2007
this is it and so far nothing ne help would be appreciated please and thank you
Reply With Quote  
Join Date: Dec 2006
Location: Romania
Posts: 171
Reputation: radu84 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 16
radu84 radu84 is offline Offline
Junior Poster

Re: !!! Help ME !!!!!

  #8  
Mar 28th, 2007
SysUtils;

{$APPTYPE CONSOLE}
// the start of the function
Function Prime














// the begging of thine main program

var
num : integer;



begin
writeln(' Enter a number from 1 to 1000 and push enter ');
readln(num);




end.

this is the entire code i have found in your file! what i think? well, you made an console application which is showing a text on screen, and read an integer from keyboard.

in that file it is explained very well which is the mecanism of finding a prime number! you don't know how to implement the procedure/function or what?

best regards,
Reply With Quote  
Join Date: Mar 2007
Posts: 17
Reputation: chickenmcnugget is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
chickenmcnugget's Avatar
chickenmcnugget chickenmcnugget is offline Offline
Newbie Poster

Re: !!! Help ME !!!!!

  #9  
Mar 28th, 2007
in way i do and it sounds like your bashing me and i said i needed help starting it thats what i said man and open up the other one thats there too above the one you opened so you know i know what im doing and btw man im not a top flight programmer thats why im here
Reply With Quote  
Join Date: Dec 2006
Location: Romania
Posts: 171
Reputation: radu84 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 16
radu84 radu84 is offline Offline
Junior Poster

Re: !!! Help ME !!!!!

  #10  
Mar 28th, 2007
Originally Posted by chickenmcnugget View Post
in way i do and it sounds like your bashing me and i said i needed help starting it thats what i said man and open up the other one thats there too above the one you opened so you know i know what im doing and btw man im not a top flight programmer thats why im here


you don't need to be an top programmer, you must want to learn, and try to understand. this is a very simple task which could be done if you took a delphi book, and try to accomplish it

code:
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
Edit1: TEdit;
Label1: TLabel;
procedure Button1Click(Sender: TObject);
private
function prime(number:integer):string;
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
Label1.Caption:=prime(strtoint(edit1.Text));
end;

function TForm1.prime(number:integer): string;
var i:integer;
prime:boolean;
begin
Label1.Caption:='';
prime:=true;
result:='prime';
if (number=1) or (number=2) or (number=3) then prime:=true
else
for i:=2 to round(sqrt(number)) do
if number mod i=0 then
begin
prime:=false;
result:='not prime';
exit;
end;
end;

end.

hope you'll try to understand this program, not only to copy it and past it.

best regards,
Last edited by radu84 : Mar 28th, 2007 at 3:00 pm.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Pascal and Delphi Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the Pascal and Delphi Forum

All times are GMT -4. The time now is 12:16 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC