What is the answer the of the question- -Enter the name your file-- #i.pdf

What is the answer the of the question, "Enter the name your file"? #include<bits/stdc++.h> #include<fstream> #include <iostream> #include<cstdlib> #include<string.h> using namespace std; int c=0; ifstream fin; int strcmp_ncase(string s1, string s2) { transform(s1.begin(),s1.end(),s1.begin(), ::toupper); transform(s2.begin(),s2.end(),s2.begin(), ::toupper); if(s1 == s2) return 1; else return 0; } int main() { cout<<"Welcome to the Name Searching Program\n"; char fil[100]; cout<<"Please enter the name your file: "; cin>>fil; fin.open(fil); while(fin.fail()) { cout<<"I'm sorry, I could not open " << fil << "Please enter another name: "; cin>>fil; fin.open(fil); } cout << "File" << fil << "opened successfully\n"; getchar(); string search; cout<<"What name would like to find in the file? "; getline(cin, search); int flag = 0; while(!fin.eof()) { string temp; c++; getline(fin,temp); int x = strcmp_ncase(search,temp); if(x == 1) { cout <<""<< temp << "is the"<<c<<"rd name in the file"<<endl; flag = 1; } } if(flag == 0) cout<<search<<"name not found in the file\n"; fin.close(); cout<<"Thank you for using he NSP\n"; return 0; }.

What is the answer the of the question, "Enter the name your file"?
#include<bits/stdc++.h>
#include<fstream>
#include <iostream>
#include<cstdlib>
#include<string.h>
using namespace std;
int c=0;
ifstream fin;
int strcmp_ncase(string s1, string s2)
{
transform(s1.begin(),s1.end(),s1.begin(), ::toupper);
transform(s2.begin(),s2.end(),s2.begin(), ::toupper);
if(s1 == s2)
return 1;
else
return 0;
}
int main()
{
cout<<"Welcome to the Name Searching Programn";
char fil[100];
cout<<"Please enter the name your file: ";
cin>>fil;
fin.open(fil);
while(fin.fail())
{
cout<<"I'm sorry, I could not open " << fil << "Please enter another name: ";
cin>>fil;
fin.open(fil);
}
cout << "File" << fil << "opened successfullyn";
getchar();
string search;
cout<<"What name would like to find in the file? ";
getline(cin, search);
int flag = 0;
while(!fin.eof())
{
string temp;
c++;
getline(fin,temp);
int x = strcmp_ncase(search,temp);
if(x == 1)
{
cout <<""<< temp << "is the"<<c<<"rd name in the file"<<endl;
flag = 1;
}
}
if(flag == 0)
cout<<search<<"name not found in the filen";
fin.close();
cout<<"Thank you for using he NSPn";
return 0;
}

Recomendados

What is the output of this code- what to put when it prompts to enter.pdf von
What is the output of this code- what to put when it prompts to enter.pdfWhat is the output of this code- what to put when it prompts to enter.pdf
What is the output of this code- what to put when it prompts to enter.pdfJoshuaQ1NReesh
2 views2 Folien
int ch=chdir(tokensleft[0]); if the change of director.pdf von
      int ch=chdir(tokensleft[0]);     if the change of director.pdf      int ch=chdir(tokensleft[0]);     if the change of director.pdf
int ch=chdir(tokensleft[0]); if the change of director.pdfmdualudin007
3 views8 Folien
file handling final3333.pptx von
file handling final3333.pptxfile handling final3333.pptx
file handling final3333.pptxradhushri
8 views45 Folien
#include iostream#include fstream#include cstdlibusingna.pdf von
#include iostream#include fstream#include cstdlibusingna.pdf#include iostream#include fstream#include cstdlibusingna.pdf
#include iostream#include fstream#include cstdlibusingna.pdfsooryasalini
4 views4 Folien
20DCE096_prac8.pdf von
20DCE096_prac8.pdf20DCE096_prac8.pdf
20DCE096_prac8.pdfShivangPithadiya1
2 views3 Folien
Write a program that asks the user for the name of a file. The progra.docx von
 Write a program that asks the user for the name of a file. The progra.docx Write a program that asks the user for the name of a file. The progra.docx
Write a program that asks the user for the name of a file. The progra.docxajoy21
11 views5 Folien

Más contenido relacionado

Similar a What is the answer the of the question- -Enter the name your file-- #i.pdf

Railway reservation von
Railway reservationRailway reservation
Railway reservationSwarup Boro
2.1K views11 Folien
c++ program for Railway reservation von
c++ program for Railway reservationc++ program for Railway reservation
c++ program for Railway reservationSwarup Kumar Boro
13.1K views11 Folien
Files von
FilesFiles
FilesKarthika Parthasarathy
796 views8 Folien
Usp von
UspUsp
Usppreethamnaik92
644 views47 Folien
oodp elab.pdf von
oodp elab.pdfoodp elab.pdf
oodp elab.pdfSWATIKUMARIRA2111030
10 views128 Folien

Similar a What is the answer the of the question- -Enter the name your file-- #i.pdf(20)

Railway reservation von Swarup Boro
Railway reservationRailway reservation
Railway reservation
Swarup Boro2.1K views
#include stdio.h #include stdlib.h #include time.h #incl.pdf von rishabjain5053
#include stdio.h #include stdlib.h #include time.h #incl.pdf#include stdio.h #include stdlib.h #include time.h #incl.pdf
#include stdio.h #include stdlib.h #include time.h #incl.pdf
import java.io.;import java.util.;public class Dictionary {p.pdf von maheshkumar12354
import java.io.;import java.util.;public class Dictionary {p.pdfimport java.io.;import java.util.;public class Dictionary {p.pdf
import java.io.;import java.util.;public class Dictionary {p.pdf
Start with the inclusion of libraries#include iostream .docx von MARRY7
 Start with the inclusion of libraries#include iostream .docx Start with the inclusion of libraries#include iostream .docx
Start with the inclusion of libraries#include iostream .docx
MARRY73 views
File handling in c language von Harish Gyanani
File handling in c languageFile handling in c language
File handling in c language
Harish Gyanani1.6K views
My c++ code will not compile and I have no idea why. Can someone hel.pdf von libowskymcinnisell69
My c++ code will not compile and I have no idea why. Can someone hel.pdfMy c++ code will not compile and I have no idea why. Can someone hel.pdf
My c++ code will not compile and I have no idea why. Can someone hel.pdf
File handling complete programs in c++ von zain ul hassan
File handling complete programs in c++File handling complete programs in c++
File handling complete programs in c++
zain ul hassan150 views
lecture-5 string.pptx von DilanAlmsa
lecture-5 string.pptxlecture-5 string.pptx
lecture-5 string.pptx
DilanAlmsa9 views
Dns server clients (actual program) von Youssef Dirani
Dns server clients (actual program)Dns server clients (actual program)
Dns server clients (actual program)
Youssef Dirani321 views
Dns server clients (actual program) von Youssef Dirani
Dns server clients (actual program)Dns server clients (actual program)
Dns server clients (actual program)
Youssef Dirani350 views

Más de JoshuaQ1NReesh

Watch the videos and explain in your own words the SCAN and C-Scan fea.pdf von
Watch the videos and explain in your own words the SCAN and C-Scan fea.pdfWatch the videos and explain in your own words the SCAN and C-Scan fea.pdf
Watch the videos and explain in your own words the SCAN and C-Scan fea.pdfJoshuaQ1NReesh
4 views1 Folie
Waiters at a restaurant chain earn an average of $257 per shift (regul.pdf von
Waiters at a restaurant chain earn an average of $257 per shift (regul.pdfWaiters at a restaurant chain earn an average of $257 per shift (regul.pdf
Waiters at a restaurant chain earn an average of $257 per shift (regul.pdfJoshuaQ1NReesh
9 views1 Folie
What type of front is purple on the map and stretches from michigan to (1).pdf von
What type of front is purple on the map and stretches from michigan to (1).pdfWhat type of front is purple on the map and stretches from michigan to (1).pdf
What type of front is purple on the map and stretches from michigan to (1).pdfJoshuaQ1NReesh
2 views1 Folie
What type of front is purple on the map and stretches from Michigan To.pdf von
What type of front is purple on the map and stretches from Michigan To.pdfWhat type of front is purple on the map and stretches from Michigan To.pdf
What type of front is purple on the map and stretches from Michigan To.pdfJoshuaQ1NReesh
1 view1 Folie
What is the World Economic Forum- Who is the founder- There is a divid.pdf von
What is the World Economic Forum- Who is the founder- There is a divid.pdfWhat is the World Economic Forum- Who is the founder- There is a divid.pdf
What is the World Economic Forum- Who is the founder- There is a divid.pdfJoshuaQ1NReesh
3 views1 Folie
What other games you can program to solve using these recursion and ba.pdf von
What other games you can program to solve using these recursion and ba.pdfWhat other games you can program to solve using these recursion and ba.pdf
What other games you can program to solve using these recursion and ba.pdfJoshuaQ1NReesh
2 views1 Folie

Más de JoshuaQ1NReesh(20)

Watch the videos and explain in your own words the SCAN and C-Scan fea.pdf von JoshuaQ1NReesh
Watch the videos and explain in your own words the SCAN and C-Scan fea.pdfWatch the videos and explain in your own words the SCAN and C-Scan fea.pdf
Watch the videos and explain in your own words the SCAN and C-Scan fea.pdf
JoshuaQ1NReesh4 views
Waiters at a restaurant chain earn an average of $257 per shift (regul.pdf von JoshuaQ1NReesh
Waiters at a restaurant chain earn an average of $257 per shift (regul.pdfWaiters at a restaurant chain earn an average of $257 per shift (regul.pdf
Waiters at a restaurant chain earn an average of $257 per shift (regul.pdf
JoshuaQ1NReesh9 views
What type of front is purple on the map and stretches from michigan to (1).pdf von JoshuaQ1NReesh
What type of front is purple on the map and stretches from michigan to (1).pdfWhat type of front is purple on the map and stretches from michigan to (1).pdf
What type of front is purple on the map and stretches from michigan to (1).pdf
JoshuaQ1NReesh2 views
What type of front is purple on the map and stretches from Michigan To.pdf von JoshuaQ1NReesh
What type of front is purple on the map and stretches from Michigan To.pdfWhat type of front is purple on the map and stretches from Michigan To.pdf
What type of front is purple on the map and stretches from Michigan To.pdf
What is the World Economic Forum- Who is the founder- There is a divid.pdf von JoshuaQ1NReesh
What is the World Economic Forum- Who is the founder- There is a divid.pdfWhat is the World Economic Forum- Who is the founder- There is a divid.pdf
What is the World Economic Forum- Who is the founder- There is a divid.pdf
JoshuaQ1NReesh3 views
What other games you can program to solve using these recursion and ba.pdf von JoshuaQ1NReesh
What other games you can program to solve using these recursion and ba.pdfWhat other games you can program to solve using these recursion and ba.pdf
What other games you can program to solve using these recursion and ba.pdf
JoshuaQ1NReesh2 views
What is X Corporation's net operating loss for the current year- a) $0.pdf von JoshuaQ1NReesh
What is X Corporation's net operating loss for the current year- a) $0.pdfWhat is X Corporation's net operating loss for the current year- a) $0.pdf
What is X Corporation's net operating loss for the current year- a) $0.pdf
JoshuaQ1NReesh2 views
What is the total assets- Determine the total assets for the period fr.pdf von JoshuaQ1NReesh
What is the total assets- Determine the total assets for the period fr.pdfWhat is the total assets- Determine the total assets for the period fr.pdf
What is the total assets- Determine the total assets for the period fr.pdf
JoshuaQ1NReesh2 views
What is the total expense for the period- The following information is.pdf von JoshuaQ1NReesh
What is the total expense for the period- The following information is.pdfWhat is the total expense for the period- The following information is.pdf
What is the total expense for the period- The following information is.pdf
JoshuaQ1NReesh2 views
What is the significance of the image below-Represent the deposition o.pdf von JoshuaQ1NReesh
What is the significance of the image below-Represent the deposition o.pdfWhat is the significance of the image below-Represent the deposition o.pdf
What is the significance of the image below-Represent the deposition o.pdf
JoshuaQ1NReesh3 views
What is the percentile rank for a raw score of 74 - given a group mean.pdf von JoshuaQ1NReesh
What is the percentile rank for a raw score of 74 - given a group mean.pdfWhat is the percentile rank for a raw score of 74 - given a group mean.pdf
What is the percentile rank for a raw score of 74 - given a group mean.pdf
JoshuaQ1NReesh2 views
What is the name for a small diameter well specifically constructed to.pdf von JoshuaQ1NReesh
What is the name for a small diameter well specifically constructed to.pdfWhat is the name for a small diameter well specifically constructed to.pdf
What is the name for a small diameter well specifically constructed to.pdf
JoshuaQ1NReesh2 views
What is the net profit- Assume the following information was made avai.pdf von JoshuaQ1NReesh
What is the net profit- Assume the following information was made avai.pdfWhat is the net profit- Assume the following information was made avai.pdf
What is the net profit- Assume the following information was made avai.pdf
JoshuaQ1NReesh2 views
What is the journal entry when the company earns cash revenues of $1-5.pdf von JoshuaQ1NReesh
What is the journal entry when the company earns cash revenues of $1-5.pdfWhat is the journal entry when the company earns cash revenues of $1-5.pdf
What is the journal entry when the company earns cash revenues of $1-5.pdf
JoshuaQ1NReesh3 views
What is the journal entry when the company borrows $40-000 cash from t.pdf von JoshuaQ1NReesh
What is the journal entry when the company borrows $40-000 cash from t.pdfWhat is the journal entry when the company borrows $40-000 cash from t.pdf
What is the journal entry when the company borrows $40-000 cash from t.pdf
JoshuaQ1NReesh3 views
what is the future value if interest rate is 7- compounded quarterly a.pdf von JoshuaQ1NReesh
what is the future value if interest rate is 7- compounded quarterly a.pdfwhat is the future value if interest rate is 7- compounded quarterly a.pdf
what is the future value if interest rate is 7- compounded quarterly a.pdf
JoshuaQ1NReesh2 views
What is the firm's cash flow from investing- ItemPrior yearCurrent yea.pdf von JoshuaQ1NReesh
What is the firm's cash flow from investing- ItemPrior yearCurrent yea.pdfWhat is the firm's cash flow from investing- ItemPrior yearCurrent yea.pdf
What is the firm's cash flow from investing- ItemPrior yearCurrent yea.pdf
JoshuaQ1NReesh2 views
What is the equilibrium level of output (Y) in this economy- Select an.pdf von JoshuaQ1NReesh
What is the equilibrium level of output (Y) in this economy- Select an.pdfWhat is the equilibrium level of output (Y) in this economy- Select an.pdf
What is the equilibrium level of output (Y) in this economy- Select an.pdf
JoshuaQ1NReesh2 views
What is the correlation coefficient is r - x left foot Right.pdf von JoshuaQ1NReesh
What is the correlation coefficient is r -  x left foot          Right.pdfWhat is the correlation coefficient is r -  x left foot          Right.pdf
What is the correlation coefficient is r - x left foot Right.pdf
JoshuaQ1NReesh2 views
What is the difference between sterilisation and disinfection- Name th.pdf von JoshuaQ1NReesh
What is the difference between sterilisation and disinfection- Name th.pdfWhat is the difference between sterilisation and disinfection- Name th.pdf
What is the difference between sterilisation and disinfection- Name th.pdf
JoshuaQ1NReesh3 views

Último

Compare the flora and fauna of Kerala and Chhattisgarh ( Charttabulation) von
 Compare the flora and fauna of Kerala and Chhattisgarh ( Charttabulation) Compare the flora and fauna of Kerala and Chhattisgarh ( Charttabulation)
Compare the flora and fauna of Kerala and Chhattisgarh ( Charttabulation)AnshulDewangan3
275 views12 Folien
7 NOVEL DRUG DELIVERY SYSTEM.pptx von
7 NOVEL DRUG DELIVERY SYSTEM.pptx7 NOVEL DRUG DELIVERY SYSTEM.pptx
7 NOVEL DRUG DELIVERY SYSTEM.pptxSachin Nitave
56 views35 Folien
11.28.23 Social Capital and Social Exclusion.pptx von
11.28.23 Social Capital and Social Exclusion.pptx11.28.23 Social Capital and Social Exclusion.pptx
11.28.23 Social Capital and Social Exclusion.pptxmary850239
112 views25 Folien
The basics - information, data, technology and systems.pdf von
The basics - information, data, technology and systems.pdfThe basics - information, data, technology and systems.pdf
The basics - information, data, technology and systems.pdfJonathanCovena1
77 views1 Folie
CWP_23995_2013_17_11_2023_FINAL_ORDER.pdf von
CWP_23995_2013_17_11_2023_FINAL_ORDER.pdfCWP_23995_2013_17_11_2023_FINAL_ORDER.pdf
CWP_23995_2013_17_11_2023_FINAL_ORDER.pdfSukhwinderSingh895865
501 views6 Folien
Community-led Open Access Publishing webinar.pptx von
Community-led Open Access Publishing webinar.pptxCommunity-led Open Access Publishing webinar.pptx
Community-led Open Access Publishing webinar.pptxJisc
69 views9 Folien

Último(20)

Compare the flora and fauna of Kerala and Chhattisgarh ( Charttabulation) von AnshulDewangan3
 Compare the flora and fauna of Kerala and Chhattisgarh ( Charttabulation) Compare the flora and fauna of Kerala and Chhattisgarh ( Charttabulation)
Compare the flora and fauna of Kerala and Chhattisgarh ( Charttabulation)
AnshulDewangan3275 views
7 NOVEL DRUG DELIVERY SYSTEM.pptx von Sachin Nitave
7 NOVEL DRUG DELIVERY SYSTEM.pptx7 NOVEL DRUG DELIVERY SYSTEM.pptx
7 NOVEL DRUG DELIVERY SYSTEM.pptx
Sachin Nitave56 views
11.28.23 Social Capital and Social Exclusion.pptx von mary850239
11.28.23 Social Capital and Social Exclusion.pptx11.28.23 Social Capital and Social Exclusion.pptx
11.28.23 Social Capital and Social Exclusion.pptx
mary850239112 views
The basics - information, data, technology and systems.pdf von JonathanCovena1
The basics - information, data, technology and systems.pdfThe basics - information, data, technology and systems.pdf
The basics - information, data, technology and systems.pdf
JonathanCovena177 views
Community-led Open Access Publishing webinar.pptx von Jisc
Community-led Open Access Publishing webinar.pptxCommunity-led Open Access Publishing webinar.pptx
Community-led Open Access Publishing webinar.pptx
Jisc69 views
JiscOAWeek_LAIR_slides_October2023.pptx von Jisc
JiscOAWeek_LAIR_slides_October2023.pptxJiscOAWeek_LAIR_slides_October2023.pptx
JiscOAWeek_LAIR_slides_October2023.pptx
Jisc72 views
Use of Probiotics in Aquaculture.pptx von AKSHAY MANDAL
Use of Probiotics in Aquaculture.pptxUse of Probiotics in Aquaculture.pptx
Use of Probiotics in Aquaculture.pptx
AKSHAY MANDAL81 views
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively von PECB
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks EffectivelyISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively
ISO/IEC 27001 and ISO/IEC 27005: Managing AI Risks Effectively
PECB 457 views
Are we onboard yet University of Sussex.pptx von Jisc
Are we onboard yet University of Sussex.pptxAre we onboard yet University of Sussex.pptx
Are we onboard yet University of Sussex.pptx
Jisc71 views
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx von ISSIP
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptxEIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx
ISSIP256 views
Class 10 English notes 23-24.pptx von TARIQ KHAN
Class 10 English notes 23-24.pptxClass 10 English notes 23-24.pptx
Class 10 English notes 23-24.pptx
TARIQ KHAN95 views
Nico Baumbach IMR Media Component von InMediaRes1
Nico Baumbach IMR Media ComponentNico Baumbach IMR Media Component
Nico Baumbach IMR Media Component
InMediaRes1425 views
Chemistry of sex hormones.pptx von RAJ K. MAURYA
Chemistry of sex hormones.pptxChemistry of sex hormones.pptx
Chemistry of sex hormones.pptx
RAJ K. MAURYA119 views
Classification of crude drugs.pptx von GayatriPatra14
Classification of crude drugs.pptxClassification of crude drugs.pptx
Classification of crude drugs.pptx
GayatriPatra1465 views

What is the answer the of the question- -Enter the name your file-- #i.pdf

  • 1. What is the answer the of the question, "Enter the name your file"? #include<bits/stdc++.h> #include<fstream> #include <iostream> #include<cstdlib> #include<string.h> using namespace std; int c=0; ifstream fin; int strcmp_ncase(string s1, string s2) { transform(s1.begin(),s1.end(),s1.begin(), ::toupper); transform(s2.begin(),s2.end(),s2.begin(), ::toupper); if(s1 == s2) return 1; else return 0; } int main() { cout<<"Welcome to the Name Searching Programn"; char fil[100]; cout<<"Please enter the name your file: "; cin>>fil; fin.open(fil); while(fin.fail()) { cout<<"I'm sorry, I could not open " << fil << "Please enter another name: "; cin>>fil; fin.open(fil); } cout << "File" << fil << "opened successfullyn"; getchar();
  • 2. string search; cout<<"What name would like to find in the file? "; getline(cin, search); int flag = 0; while(!fin.eof()) { string temp; c++; getline(fin,temp); int x = strcmp_ncase(search,temp); if(x == 1) { cout <<""<< temp << "is the"<<c<<"rd name in the file"<<endl; flag = 1; } } if(flag == 0) cout<<search<<"name not found in the filen"; fin.close(); cout<<"Thank you for using he NSPn"; return 0; }