User Profile

Collapse

Profile Sidebar

Collapse
compsci
compsci
Last Activity: Feb 5 '08, 05:15 PM
Joined: Jan 25 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • compsci
    replied to Beginner in Java
    in Java
    I only have a for loop

    Code:
    for (int x = 1; x<= 1; x++)
    See more | Go to post

    Leave a comment:


  • compsci
    started a topic Beginner in Java
    in Java

    Beginner in Java

    I want to know how to start a program by asking the user to input 5 integers and take the smallest from it.
    I know I am using a for loop and logical operators but I have no idea on how to begin.
    See more | Go to post

  • compsci
    started a topic Complicated Program
    in C

    Complicated Program

    I want my program to have numbers 1 through 10. I want it to have a sets of 5 numbers and list all the combinations that it can have. I don't want one number to be use twice in a set. This is what i have so far.
    Code:
    array [x]
    int x = 0;
    x = rand();
    
        while (x<0 && x<10)
    See more | Go to post

  • compsci
    replied to C++ Program help
    in C
    In my function gross pay i have the hours and payrate reading from the file. But it is not working...
    See more | Go to post

    Leave a comment:


  • compsci
    started a topic C++ Program help
    in C

    C++ Program help

    Im tryin to read the hours and payrate for 75 employees from a called file “employee.data” . This is what I have so far. Can anyone help me?


    Code:
    #include <iostream>
    #include <fstream>
    using namespace std; 
    
    	float grosspay();
    	float netpay(float);
    	
    
    	int main()// Starts the program
    	{
    
    
    
    	float gross=0;// Declares gross as a float
    ...
    See more | Go to post

  • compsci
    started a topic C++ Books
    in C

    C++ Books

    I'm a beginner in C++ programming. Do anyone know a great C++ book to use that would be beneficial to me?
    See more | Go to post

  • compsci
    replied to Loop Problem
    in C
    Okay I'm ready
    See more | Go to post

    Leave a comment:


  • compsci
    replied to Loop Problem
    in C
    I am trying to make functions of the following:
    • adjustParticip returns the adjustment factor reflecting the student’s class participation. It is passed the 0-10 evaluation of the student’s class participation as well as a character ‘C’ or ‘L’. For ‘C’, it delegates to on_campus_adjus tParticipation, for ‘L’, it delegates to online_ adjustParticipa tion,.
    • score2letter is passed a numerical course score and...
    See more | Go to post

    Leave a comment:


  • compsci
    started a topic Loop Problem
    in C

    Loop Problem

    While the status is at C or L, I want the user to input the participation and print it to the screen. I can't get my online_adjustPa rticipation function to run either. Everytime I run it, it loops the same amount of times as the first loop.

    Code:
    #include <iostream>
    using namespace std;
    double examContrib(double exam, char status);
    double assignContrib(double assign, char status);
    double on_campus_examContrib(double
    ...
    See more | Go to post

  • compsci
    started a topic Trouble with while loop
    in C

    Trouble with while loop

    I'm having a problem trying to write a loop that tells the user to input a positive number. And if number is zero the program stops. The numbers can be no greater than 1000.

    Code:
    # include <iostream>
    using namespace std;
    
    int main()
    {
    	int i;
    	int num;
    	
    	while (num >0)
    	{
    
    	cout<< "Enter a positive number:"<<endl;
    	cin>>
    ...
    See more | Go to post

  • compsci
    replied to variable types
    in C
    Thanks. I understand now.
    See more | Go to post

    Leave a comment:


  • compsci
    started a topic variable types
    in C

    variable types

    I have my program but Im having problems printing my variables to the screen.


    Code:
    #include<iostream>
    #include <string>
    
    using namespace std;
    
    int overtime(int ); 
    
    int federal(int );
     
    int main ()
    {
    	//overtime(int hours);
    	int extra, hours, x, y, z, a, b,d;
    	
    	
    	cout << "Enter first name" <<endl;
    ...
    See more | Go to post

  • compsci
    started a topic Help with code
    in C

    Help with code

    I have most of my code I just need help with these last 2.

    3. Define a function validScore that, passed a score, returns true if the score is between 0 and 100 and otherwise returns false. Using this function, modify the loop that reads in the scores so that, if the score is not valid, it is echoed with a message saying that the score is invalid, and so that the score is counted and added to the sum only when it is valid. (Note that...
    See more | Go to post

  • compsci
    replied to New program
    in C
    I'm not too sure aboit the function I made. Is it right?


    Code:
    include<iostream>
    using namespace std;
    
    funct average(countScores, sumScores);
    average = countScores / sumScores;
    return average;
    
    int main() {
     int countScores = 0;
     int sumScores = 0; 
     cout <<"Enter score"<< endl;
     int n = 0;
     cin>>n;
     while(n
    ...
    See more | Go to post

    Leave a comment:


  • compsci
    replied to New program
    in C
    [QUOTE=horace1]can you work out the average in main() then when that works figure out how to use a function
    [code]
    Code:
    cout<<"You entered "<<countScores<<" numbers"<<endl;
     cout<<"Their sum is :"<<sumScores<<endl;
    int average= ...                ;
    cout << "average is :" << average<<endl;
    I think I would...
    See more | Go to post

    Leave a comment:


  • compsci
    replied to New program
    in C
    That is what I need help on....
    See more | Go to post

    Leave a comment:


  • compsci
    started a topic New program
    in C

    New program

    I'm trying to write a program that does the following:


    1. Repeatedly read a student score (for an exam) and add it to a running sum. Count the number of scores entered. (We’ll assume that the scores are between 0 and 100.) Stop when the user enters a negative number. Output the sum and count of the scores.
    2. Define a function average that, passed the sum of the scores and the count of the scores, computes the average...
    See more | Go to post

  • compsci
    replied to Programming
    in C
    This is all I have for the function so far. Is this right?

    Define a function average that, passed the sum of the scores and the count of the scores, computes the average score, which it returns. In main, call this function just after the above loop, and output the average score that the function returns.
    Code:
    funct average(sumScores, countScores)
    
    average = sumScores/ countScores;)
    
    return average;
    See more | Go to post

    Leave a comment:


  • compsci
    replied to Programming
    in C
    I don't know what else to do. Somebody please help me

    Code:
    int main()
    {
    	cout << “Enter score” << endl;
    	cin << n;
    
    	int countScores, sumScores, scores;
    
    for (scores = 0; n< 0;  countScores +1)
    {
         n= i;
         cout << j << endl; 
    
    }
    See more | Go to post

    Leave a comment:


  • compsci
    replied to Programming
    in C
    I'm having a hard time doing this program
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...