Forum > Beginners

begginer - problem with function/program based on it. pascal

(1/3) > >>

clara22:
 Hello, i started working with pascal couple days ago ... but i cant figure out how to do this right .. i m learning by myself and i cant really figure this type of examples .. i did many programs/functios right but this one .. :( can maybe some one type this one for me with little description of process ? ..
Thanks a lot
 ..

A positive integer N is called a " fair " if it is divisible by each of its digits. For example, the number 132 is fair , because it is divisible by 1 , 3 and 2. In contrast the number 123 is not fair, since , although divisible by 1 and 3 but not divisible by 2. Write a function that determines whether a fair number N ( N the parameter is a function). Next, write a program which uses this function finds and displays all the honest numbers range from A to B, including ( value of A, B will be awarded to the entry of the program - are positive integers from the range of data type integer.

marcov:

--- Quote from: clara22 on November 05, 2014, 12:58:12 pm --- Hello, i started working with pascal couple days ago ... but i cant figure out how to do this right .. i m learning by myself and i cant really figure this type of examples .. i did many programs/functios right but this one .. :( can maybe some one type this one for me with little description of process ? ..

--- End quote ---

So how far did you get? Did you translate the example into pseudo code? Most people won't do homework assignments for you, but if you show you have put in some effort you might get help.

Bart:
By pseudocode marcov means that you write down an algorithm in something that is not real code yet, like (fictitious example):
count all persons
count all apples
while apples > persons do
begin
  give apple to each person
  count all apples
end
remainder = apples left
eat remainder

Bart

clara22:
Sorry :p i have been working with that program just for like 4 days i have no idea how to write down program with function i have been learning all by my self .. so i m kind of lost that why i was looking for little description on a side . . for now i have this but its ... sorry but i cant send picture . Some error shows up that telling me to contact administrator.. never mind i will try elsewhere but anyway thanks for your time :)

BigChimp:
Don't send a picture please, copy and paste your source code.

Then put them between [ code ] [ /code ] tags (remove spaces please) so the forum software does not mess up the contents.

Navigation

[0] Message Index

[#] Next page

Go to full version