Find Jobs
Hire Freelancers

Write a few litle c++ programs

$10-30 USD

Closed
Posted over 8 years ago

$10-30 USD

Paid on delivery
Those are the tasks which should be finished, code should be pasted in this text. For the tasks which require to list errors, please use // comments 6. (4 points) List the errors in the code below. int *p1 , p2 , &p3; p2 = 5; *p1 = &p2; cout << &p1 << endl ; 7. (4 points) List the errors in the block of code below. int mat [][5]; for(int i = 0; i < 5; i++) { mat [i] = 7; } cout << mat [i][i] << endl ; 8. (7 points) What does the following block of code print? Show how you calculated the result. int a [10]; for(int i = 0; i < 10; i++) a[i] = 9-i; for(int i = 0; i < 10; i++) { a[i] = a[a[i]]; cout << a[i] << " "; } 9. (8 points) What does the following program print? Show how you calculated the result. int fun(int x, int y, int z) { if(x <0 || z >10) return y +1; else return fun(x -1, y, z) + fun (x, y, z +2); } int main () { cout << fun (1, 2, 7)<< endl ; return 0; } 10. (6 points) Write a programm which as input takes two real numbers x and y and calculates x to the power of y. Make sure that both numbers are positive. 11. (16 points) Write a program which asks a user for a number n not larger than 20. Program then creates a matrix of size n times n and fills it with random numbers in range from 0 to 3n. Matrix is then printed. Finally, index of the row which has a smallest sum of elements is printed. 12. (16 points) While generating a password by selecting random characters generally gives a relatively secure password, it also generally gives a password that is difficult to memorize. As an alternative, some systems construct a password by taking two English words and concatenating (joining) them. While this password is not as secure, it is much easier to memorize. Write a program that reads a file named words.txt. The first line of the file holds the total number of words in a file. Other lines hold a single word. For testing you can create this file yourself with some words in it. Program randomly selects two of them, and concatenates (joins) them to produce a new password. When producing the password ensure that the total length is between 8 and 10 characters, and that each word used is at least three letters long. Capitalize each word in the password so that the user can easily see where one word ends and the next one begins. Display the password for the user. 13. (14 points) Write a function which checks if two strings are anagrams. Function needs to ignore difference between capitalized and non capitalized letters as well as punctuation. Two strings are said to be anagrams if letters of one can be rearranged so they form second string. For example, string "A decimal point!" is anagram of string "I'm a dot in place". [Hints. Assume following two functions are available. Function bool isalpha(char c) returns true if char c is a letter, and false if it is some other character. Function int toupper(char c) returns capitallized letter which is in variable char c. Letter "A" is at 65th position of ASCII table.] 14. (10 points) Given a number n, compute recursively number of the occurrences of 8 as a digit, with special case where an 8 with another 8 immediately to its left counts double, so 8818 returns 4. More examples: 8 returns 1; 5858 returns 2; 58888 returns 7. For partial credit (5 points) simply count number of eights recursively. [Hints. Mod (%) by 10 yields the rightmost digit (126 % 10 is 6), while divide (/) by 10 removes the rightmost digit (126 / 10 is 12).]
Project ID: 9578408

About the project

38 proposals
Remote project
Active 8 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
38 freelancers are bidding on average $25 USD for this job
User Avatar
Hi. i have a lot of experience in C++ programming. I can easily help you with this project in 2 hours. we can have a chat about it. thanks
$40 USD in 1 day
4.9 (325 reviews)
7.4
7.4
User Avatar
Hi, I went through the requirements and I would like to do this project if given the opportunity. Let me know if you are interested so I can start. Thanks.
$30 USD in 1 day
5.0 (649 reviews)
7.3
7.3
User Avatar
Hi, I am an experienced C++ programmer. I can solve these tasks easily. Please contact me via private message.
$30 USD in 1 day
4.9 (115 reviews)
6.4
6.4
User Avatar
project will be done in 1 hour maximum .............................................................................
$15 USD in 1 day
4.9 (42 reviews)
5.3
5.3
User Avatar
I can | I can | I can | I can | I can | I can | I can | I can | I can | I can | I can | I can | I can | I can | I can | I can | I can | I can | I can | I can | I can | I can | I can | I can | I can |
$24 USD in 1 day
4.8 (40 reviews)
5.2
5.2
User Avatar
Hi i can do this in next 1 hour let me know if you are interested ... have a good day ... waiting for your reply ..
$15 USD in 1 day
4.8 (14 reviews)
4.7
4.7
User Avatar
Hello, my name is Kostas and I am an experienced c++ developer. Before I go into details, I would like to tell you that this is my first time on this site and hence you can see that I do not have any ratings/testimonials to show you. I can assure you that if you work with me once, you will always work with me for these kind of projects. In order to prove you my knowledge, I will give you 2 answers of your questions: For question number 6: 6. (4 points) List the errors in the code below. int *p1 , p2 , &p3; //error: ‘p3’ declared as reference but not initialized p2 = 5; //ok *p1 = &p2; //wrong, *p1 is a dereferenced pointer. Correct is : p1=&p2; cout << &p1 << endl ; For question number 10, create a function that takes 2 real numbers and produces the x^y is : #include<iostream> using namespace std; int power(int x, int y) { if(x < 0 || y < 0 ) { cout << "Negative numbers are not allowed" << endl; } int result = 1; for(int i = 0; i < y; ++i) { result *= x; } return result; } int main() { cout << "Hello, enter 2 integers" << endl; int x, y; cin >> x >> y; int result = power(x, y); cout << result << endl; } It very easy to convert this function to work with floats as well(if it is needed). I really do hope that we work together! I will have them finished in a day! Thank you in advance, Kostas.
$15 USD in 1 day
5.0 (23 reviews)
4.1
4.1
User Avatar
Thanks for your project. I have 25 years experience programming in C++. I will complete these programming exercises. A milestone payment for the full budget for this project must be deposited with this site before your offer can be accepted. Alan Idler Chief Software Architect Idleswell Software Creations
$160 USD in 3 days
4.7 (4 reviews)
4.4
4.4
User Avatar
Hi, I am Ahsan. I am a Computer Science Student. It's my 5th semester right now. I have studied these courses including Introduction to Computer Science, Computer Programming, Data Structures, Databases I have maintained a very good grade in all above subjects. I have done different projects in c++ from the simplest "Tic Tac Toe" to the toughest "Chess". I have done many other projects including "Paint", "Scheduler" and "Inventory Management System" I have implemented many data structures in c++ including stack, queue, circular queue, singly link list. doubly link list, circular link list, Trees, min heap, max heap I find myself best for your work as I do the c++ practice on the regular basis. Regards
$40 USD in 1 day
4.9 (22 reviews)
3.6
3.6
User Avatar
Hello, Well, you sure have lots of programme that you need to be written. I would like to know whether you want all of them in a single timeframe or is there any option to discuss them with you before moving ahead with all of them. Let me know your thoughts about it. Warm Regards, Sam
$25 USD in 1 day
5.0 (1 review)
2.7
2.7
User Avatar
Hello. This is fairly straightforward work. I'll be available on Skype or email even after delivery in case you need assistance with getting the code up and running. Take care.
$15 USD in 1 day
5.0 (1 review)
2.4
2.4
User Avatar
Hi Don't be worry you are at right place for your job.I'll provide you quality work and high customer satisfaction in short time with money back guarantee. If you don't believe me then place order on my gig, i assure you will be 200% satisfied with me Thanks
$20 USD in 1 day
5.0 (2 reviews)
1.7
1.7
User Avatar
<<<< i can help you low budget PLEASE CHAT ME >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> ___________________________________________________________________________________________________________________
$10 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
Hi! Nice to know u. I can help you in no time. I have many experiences for this type of work. You will feel satisfied my job. I am ready work for you hardly. Best regards.
$30 USD in 0 day
0.0 (0 reviews)
0.0
0.0
User Avatar
I had great experience in programming. Give me one chance I will complete it within the required time.
$12 USD in 2 days
0.0 (0 reviews)
0.0
0.0
User Avatar
Hi. I work as teaching assistant in Faculty of Computers and Information, Assiut University. I have solved many of programming sheets in sections with students. I have been in this work for more than 7 years. I assure you to deliver correct answers and help on further programming problems.
$10 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
It is a simple academic questions. they can be solved easily. allp 6. (4 points) List the errors in the code below. int *p1 , p2 , &p3; p2 = 5; *p1 = &p2; cout << &p1 << endl ; 7. (4 points) List the errors in the block of code below. int mat [][5]; for(int i = 0; i < 5; i++) { mat [i] = 7; } cout << mat [i][i] << endl ; 8. (7 points) What does the following block of code print? Show how you calculated the result. int a [10]; for(int i = 0; i < 10; i++) a[i] = 9-i; for(int i = 0; i < 10; i++) { a[i] = a[a[i]]; cout << a[i] << " "; } 9. (8 points) What does the following program print? Show how you calculated the result. int fun(int x, int y, int z) { if(x <0 || z >10) return y +1; else return fun(x -1, y, z) + fun (x, y, z +2); } int main () { cout << fun (1, 2, 7)<< endl ; return 0; } 10. (6 points) Write a programm which as input takes two real numbers x and y and calculates x to the power of y. Make sure that both numbers are positive. 11. (16 points) Write a program which asks a user for a number n not larger than 20. Program then creates a matrix of size n times n and fills it with random numbers in range from 0 to 3n. Matrix is then printed. Finally, index of the row which has a smallest sum of elements is printed. 12. (16 points) While generating a password by selecting random characters generally gives a relatively secure password, it also generally gives a password that is difficult to me
$24 USD in 2 days
0.0 (0 reviews)
0.0
0.0
User Avatar
I have been programming in C++ for several years now, and I frequently write small programs for various purposes. Writing the programs you require will not be an issue, and I can get it done extremely quickly.
$15 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
i have studied C++ in my high school. Currently doing course on Programming, Data Structures and algorithm. Also, I was shortlisted for Zonal Informatics Olympiad in india. Please feel free to contact me for negotiation
$25 USD in 1 day
0.0 (0 reviews)
0.0
0.0
User Avatar
We may come on Skype to discuss further.
$30 USD in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of INDIA
Allahabad, India
0.0
0
Member since Mar 15, 2011

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.