User Profile

Collapse

Profile Sidebar

Collapse
socondc22
socondc22
Last Activity: Oct 26 '07, 03:56 AM
Joined: Sep 13 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • socondc22
    replied to Need info
    in C
    am i not right with what i just said??
    See more | Go to post

    Leave a comment:


  • socondc22
    replied to Need info
    in C
    the datatype of my input is char... and the datatype of my output is an int because i want to count the amount of letters until i reach a letter a...
    See more | Go to post

    Leave a comment:


  • socondc22
    replied to Need info
    in C
    but other than that I'm kind of lost on what to do...
    See more | Go to post

    Leave a comment:


  • socondc22
    replied to Need info
    in C
    like i know id start off with

    Code:
    int main()
    cout find_a(cin)
    return 0;
    and then there should be more

    im thinking i should use int istream and then a do while loop to count.... does that sound right?...
    See more | Go to post

    Leave a comment:


  • socondc22
    replied to Need info
    in C
    ok he said our main function only needs these two lines of code:

    Code:
    cout find_a(cin);
    return 0;
    ...
    See more | Go to post

    Leave a comment:


  • socondc22
    replied to Need info
    in C
    My professor called it a hypothetical function. And also said This function will take a arbitrary input stream reference as a parameter, then read characters in from the stream until it finds an 'a'. The function should then return the number of characters read.

    I'm pretty sure i know how to have it count the number of characters. Its more or less trying to figure out how to use find_a()....
    See more | Go to post

    Leave a comment:


  • socondc22
    started a topic Need info
    in C

    Need info

    I'm trying to write a program with the function of find_a()... i haven't learned this yet so i was wondering if anyone knew anything about it or could point me in the right direction to find out something about it...
    See more | Go to post

  • socondc22
    replied to rerun program
    in C
    i can rerun it now... but now everytime it does not print out my answers..

    [CODE=c]
    do
    {

    cout<<"Metric to English and English to Metric converter.\n"
    <<"For Metric to English type m, for Enlish to Metric type E, Type q to quit.\n";
    cin>>letter;

    get_numbers(fir st_num, second_num);

    if(letter == 'm' ||...
    See more | Go to post
    Last edited by pbmods; Oct 14 '07, 07:33 PM. Reason: Fixed CODE tags.

    Leave a comment:


  • socondc22
    started a topic rerun program
    in C

    rerun program

    just wondering how to rerun my program after printing out the answer...
    See more | Go to post

  • Converting English to Metric and vice versa via pass-by-reference void function.

    Im stuck at this point. The way i was trying to do this was running if statement around my void function and then a else if statement around a different void function but it didnt work... right now i deleted part of what i had but left my skeleton of it there...

    [CODE=c] #include <iostream>
    using namespace std;
    void get_numbers(dou ble& input1, double& input2);
    void show_results(do uble output1,...
    See more | Go to post
    Last edited by pbmods; Oct 14 '07, 07:35 PM. Reason: Changed [CODE] to [CODE=c].

  • socondc22
    replied to if else statements
    in C
    Code:
    int main()
    {
      char letter;
    
      cout<<"Metric to English and English to Metric converter.\n"
          <<"For Metric to English type m, for Enlish to Metric type E, Type q to quit.\n";
      cin>>letter;
    
         double first_num, second_num;
    
         get_numbers(first_num, second_num);
         show_results(first_num, second_num);
    ...
    See more | Go to post

    Leave a comment:


  • socondc22
    replied to if else statements
    in C
    Can someone tell me why i can't do this and help me out with what i should do...

    Code:
    if(letter == 'm' || letter == 'M')
    
    {void get_numbers(double& input1, double& input2)
     {
      using namespace std;
      cout<< "Enter first number as meters and second as centimeters.\n";
      cin>> input1
         >> input2;
      input1 = input1 * 3.2808399;
      input2 =
    ...
    See more | Go to post

    Leave a comment:


  • socondc22
    replied to if else statements
    in C
    I only have those three choices. so i figured i could do if, then if else, then if else again and it would be fine.... also im getting an error because im using if outside of my int main() for void functions... am i not allowed to do that?...
    See more | Go to post

    Leave a comment:


  • socondc22
    started a topic if else statements
    in C

    if else statements

    if i want to have a selection that uses letters such as m for metric, e for english, or q for quit to select which part of my if else statement i want to run... how would i set that up... i want to say that it would be....

    Code:
    cin>> letter;  
    if(letter == 'm')
    See more | Go to post

  • socondc22
    replied to void functions
    in C
    my real question is that when i use void swap_numbers is that just going to swap the numbers... or is there something that i should use instead that is used for if im converting numbers and not swapping
    See more | Go to post

    Leave a comment:


  • socondc22
    replied to void functions
    in C
    This is my exact program that i have to write. Now if i get inputs using void get_numbers (int& input1, int& input2). then when i use void swap_values would that be where my conversion would take place?



    1. ask the user if he wants to convert from metric (m), convert from english (e), or quit (q);
    2. get either feet & inches or meters & centimeters from the user;
    3. perform the...
    See more | Go to post

    Leave a comment:


  • socondc22
    replied to void functions
    in C
    Ok... can anyone help me with how i should start this... i went through the tutorial and i didn't understand how i could do this program with a void function...
    See more | Go to post

    Leave a comment:


  • socondc22
    replied to void functions
    in C
    this just doesn't seem like it would be the easiest way to write the program that i have to write..
    See more | Go to post

    Leave a comment:


  • socondc22
    replied to void functions
    in C
    no i havent... do you know of any i can go through?...
    See more | Go to post

    Leave a comment:


  • socondc22
    started a topic void functions
    in C

    void functions

    I'm trying to figure out why my prof would want us to run a conversion of metric to english and english to metric through a void function and using call-by-reference. Also i was wondering if anyone had any points in how to start this, i really don't understand the void functions with call-by-reference.
    See more | Go to post
No activity results to display
Show More
Working...