Results 1 to 7 of 7

Thread: Plz can someone help.. :(

  1. #1
    Assad_786 is offline Junior Member
    Last Online
    27th February 2010 @ 10:22 AM
    Join Date
    07 Mar 2009
    Posts
    26
    Threads
    11
    Credits
    0
    Thanked
    0

    Default Plz can someone help.. :(

    Salam / Helloo,

    hope every1 is dng fyn...

    I need help on the followng question itz my HW n i cant get it...
    can smeone plz help wth it...i will really appricatie...

    thnkzz in advance....

    HEREZ THE QUESTION:-----


    1)Write a code Segment to Open a file and sum the contents of the file. The contents are all integers

    2)Write a code segment to send the following to the screen properly formatted
    Emp ID Hourly Rate Hours Gross Pay Tax Net Pay
    99999 99.99 9999 999999.99 999.99 999999.99

    3)Write a code segment to use a chained if. Read in an angle and determine which quadrant it is in. If a values falls on an axis specify that. 0,180,360 x-axis, 90,270 y-axis.

    4)Allow the user to enter two an integers a starting point and an ending point then write a for, while and do loop (three separate loops doing the same thing) to display a table showing the square, cube and square root of the numbers in the range.

    5)Write a nested if statement. Determine if a user is a member of a club, If they are female display hello madam, if they are male display hello sir. If they are not a member, if they are 21 ask if they would like to join. Write all of the required output and input statements as well as the if statements.

    6)Write a complete program. You work for the Court system. You will be given a file. The file has two pieces of information in it. The drive ID and the violation number. Each violation carries a fine and points. Read the file and generate a report to a file and to the screen of fines and points for each driver and violation combination.

  2. #2
    SufyanGujar is offline Senior Member+
    Last Online
    29th December 2010 @ 10:59 PM
    Join Date
    10 Oct 2009
    Location
    England, UK
    Age
    34
    Posts
    157
    Threads
    10
    Credits
    0
    Thanked
    7

    Default

    First of all, i spouse u have good understanding of language and know how to code in C++, but u are struggling with these topics, so i will tell u methods to carry out these tasks, i wont go in depth, but i will explain basic methods u can use for this assignment;

    1) u can use this method to open and edit files.

    Code:
    #include <iostream>
    #include <fstream>
    using namespace std;
    
    int main () {
      ofstream myfile;
      myfile.open ("example.txt");
      myfile << "Writing this to a file.\n";
      myfile.close();
      return 0;
    }
    2) U can use this method to increase/decrease decimal points and after that its very simple to output em in order..

    Code:
    // number to decimal place
    	
    #include <iostream>
           
    	int main()
     {
    		double x = 2.3767553235;
        
    		std::cout.precision(2);
    
    		std::cout << x << '\n';
    
    		system ("PAUSE");
    		
    		return 0;
    	}
    3) Sry dont know in C++ but i can sure tell u how to do that in Visual basic 2008

    4) Simple use of loops, jst declare variables to take input and assign answer to a variable and output to screen, using loops as required.

    5) same as number 4, only difference is, instead of loops this time u gota use if statements.

    6) idk, i think u can use 1st method to open/write to a file, rest is upto u, u can either use if statements or loops,

    umeed karta hoon aap ko samaj aa gai ho gi,

  3. #3
    Naeem Akbar is offline Senior Member+
    Last Online
    19th May 2012 @ 08:51 PM
    Join Date
    20 Dec 2009
    Age
    34
    Posts
    64
    Threads
    11
    Credits
    0
    Thanked
    0

    Default

    Good

  4. #4
    Naeem Akbar is offline Senior Member+
    Last Online
    19th May 2012 @ 08:51 PM
    Join Date
    20 Dec 2009
    Age
    34
    Posts
    64
    Threads
    11
    Credits
    0
    Thanked
    0

    Default

    very good

  5. #5
    *Tamraiz*'s Avatar
    *Tamraiz* is offline Advance Member+
    Last Online
    29th August 2022 @ 08:08 AM
    Join Date
    26 Nov 2010
    Location
    Sialkot
    Gender
    Male
    Posts
    16,583
    Threads
    1051
    Credits
    1,207
    Thanked
    1738

    Default

    good

  6. #6
    Shining Star's Avatar
    Shining Star is offline Senior Member+
    Last Online
    25th November 2011 @ 10:38 PM
    Join Date
    02 Dec 2010
    Gender
    Male
    Posts
    201
    Threads
    2
    Credits
    0
    Thanked
    2

    Default

    okay

  7. #7
    Shining Star's Avatar
    Shining Star is offline Senior Member+
    Last Online
    25th November 2011 @ 10:38 PM
    Join Date
    02 Dec 2010
    Gender
    Male
    Posts
    201
    Threads
    2
    Credits
    0
    Thanked
    2

    Default

    good

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •