6 Replies - 419 Views - Last Post: 12 February 2010 - 05:04 PM Rate Topic: -----

#1 Guest_dou2*


Reputation:

help in C++

Posted 11 February 2010 - 12:26 PM

Hi everyone
Hope all fine..
please I wana some help in C++ programming
here is my Q: A program that will specify whether a given number could be an octal number or not

I do not know which order would I use with it.. so please at lest give some notes

ThaNx *^_^
:rolleyes:

This post has been edited by JackOfAllTrades: 11 February 2010 - 12:59 PM
Reason for edit:: Arg! My eyes! Removed obnoxious formatting

Is This A Good Question/Topic? 0

Replies To: help in C++

#2 Martyn.Rae  Icon User is offline

  • The programming dinosaur
  • member icon

Reputation: 540
  • View blog
  • Posts: 1,406
  • Joined: 22-August 09

Re: help in C++

Posted 11 February 2010 - 12:28 PM

May I draw your attention to the forum rules. You need to provide us some code or a concrete question or two. Take a look at the C++ tutorials.
Was This Post Helpful? 0
  • +
  • -

#3 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6031
  • View blog
  • Posts: 23,414
  • Joined: 23-August 08

Re: help in C++

Posted 11 February 2010 - 01:00 PM

Might I suggest in the future spending a little more time studying your notes, and less time trying to figure out the most obnoxious way to post a request for help?

That said, we're not going to write your code for you. Please re-read our policy:

Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this:

Thank you for helping us helping you.
Was This Post Helpful? 0
  • +
  • -

#4 Guest_dou2*


Reputation:

Re: help in C++

Posted 12 February 2010 - 09:20 AM

I know it's really simple program, but I am just started learning c++ programming
any way this is what I wrote in my programming :


http://www.4shared.com/file/220595276/77936b87/pro1.html][IMG]http://dc197.4shared.com/img/220595276/77936b87/pro1.png?rnd=0.9745896916417538[/URL][/img]

all i need is help me which order should usse to check digits if there any digit more than 7 so it's not an octal number and if all digits are betwen 0 and 7 so it's an octal number.
this is my idea about the answer so ... please correct me :sad3:
Thans

Was This Post Helpful? 0

#5 Martyn.Rae  Icon User is offline

  • The programming dinosaur
  • member icon

Reputation: 540
  • View blog
  • Posts: 1,406
  • Joined: 22-August 09

Re: help in C++

Posted 12 February 2010 - 09:32 AM

You are correct. Any number that does not contain 8 or 9 COULD possibly be an octal number.
Was This Post Helpful? 0
  • +
  • -

#6 AmitTheInfinity  Icon User is offline

  • C Surfing ∞
  • member icon

Reputation: 117
  • View blog
  • Posts: 1,559
  • Joined: 25-January 07

Re: help in C++

Posted 12 February 2010 - 09:35 AM

First, always post your code in code tags instead of posting links to snapshot of your code.

Now about your code. What you have written there will tell you that if the entered value is Octal digit, so even if someone enters 11 which is a valid octal number (9 in decimal) you will say this is not octal number.

What you need to do is, extract each digit of number entered (mod operator?) and check if that digit is below 7, if it's above stop and print it's not octal. Keep doing this until you number reaches to 0 (all digits checked). If you reach till this then it means number is octal, otherwise you already printed the result and returned.

I hope this will help you. :)
Was This Post Helpful? 0
  • +
  • -

#7 Dou2  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 12-February 10

Re: help in C++

Posted 12 February 2010 - 05:04 PM

THANX alot ^_^

you really helped me

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1