Make a program that:
a)create / read prepared text file with random figures
b)search the pointed from the user value with the method with search step
c)demand is realized with two different steps 2 <= k <n
d)count comparisons during the search in both cases (for both values of k)
e)returns data in the same file

P.S. Sorry, if you don't understand something, I translated the text from Bulgarian. If someone can help, please.

Recommended Answers

All 3 Replies

hey i'm new here too but from what i've noticed people aren't gonna help you if you just list what you need to do. you need to put forth some type of effort and show a particular area of code you need help with.

Well, all I have is this and I don't know if it's right:

#include <fstream.h>
#include<iostream.h>

void main()
{ifstream f1;

f1.open(“D:\\mydoc\\a.cpp”,ios::in);

f1 >>Na;

for (k=1; k<=Na; k++) f1 >>a[k];

Please use code tags (press the code button next time before you paste your code).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.