
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Question
![Script 3 - C/C++ Template File Maker
I often complain that I need to make a script or a macro to setup the skeleton of
a C/C++ code file for me since I get tired of typing it every single time.
Create a script named code TemplateMaker.sh that takes a -c or -cpp and creates
a C or C++ template file.
Syntax:
./codeTemplateMaker.sh <-c-cpp>
Use Case:
./codeTemplateMaker.sh -c
Output:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv)
{
}
Use Case:
./codeTemplateMaker.sh -cpp
Output:
#include <iostream>
#include <stdlib.h>
using namespace std;
//TODO: Code goes here
return 0;
int main(int argc, char** argv)
{
}
Use Case:
Output:
//TODO: Main code.
return 0;
./codeTemplateMaker.sh
usage: ./codeTemplateMaker.sh [-cl-cpp]](https://content.bartleby.com/qna-images/question/1027cba2-85fd-4401-a389-5e49baac07e3/b254eded-9574-40ee-8427-d896f9a6bc6f/6onims4_thumbnail.png)
Transcribed Image Text:Script 3 - C/C++ Template File Maker
I often complain that I need to make a script or a macro to setup the skeleton of
a C/C++ code file for me since I get tired of typing it every single time.
Create a script named code TemplateMaker.sh that takes a -c or -cpp and creates
a C or C++ template file.
Syntax:
./codeTemplateMaker.sh <-c-cpp>
Use Case:
./codeTemplateMaker.sh -c
Output:
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv)
{
}
Use Case:
./codeTemplateMaker.sh -cpp
Output:
#include <iostream>
#include <stdlib.h>
using namespace std;
//TODO: Code goes here
return 0;
int main(int argc, char** argv)
{
}
Use Case:
Output:
//TODO: Main code.
return 0;
./codeTemplateMaker.sh
usage: ./codeTemplateMaker.sh [-cl-cpp]
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Please the code must be in c program Complete the two functions rotate_right and sudoku_checker according to the specifications given in the associated comments. NOTES: the given starter code includes a display function and a function which reads a board from a file. As given, the main program attempts to read a 9x9 board from an input file given on the command line"arrow_forwardProject 8 Specifications Using OOP, write a C++ program that will read in a file of names and a file of birth years. The file of names is called Names.txt and the file of birth years is called BirthYear.txt. Both input files should be located in the current directory of your program. The list of names in the Names.txt file corresponds to the list of birth years in the BirthYears.txt file. This means:The first name in the names.txt file corresponds to the first birth year in the birthyear.txt file. The second name in the names.txt file corresponds to the second birth year in the birthyear.txt file...and so on.Read in and store the names into an array of 30. Next read in and store the birth years into another array of 30 integers.Sort the arrays using the selection sort or the bubblesort code found in your textbook. List the roster of names in ascending alphabetical order displaying their birth years beside their names.Next, prompt the user to enter a birth year. Validate this…arrow_forwardfunction name- def my-polyarrow_forward
- FileAttributes.c 1. Create a new C source code file named FileAttributes.c preprocessor 2. Include the following C libraries a. stdio.h b. stdlib.h c. time.h d. string.h e. dirent.h f. sys/stat.h 3. Function prototype for function printAttributes() main() 4. Write the main function to do the following a. Return type int b. Empty parameter list c. Declare a variable of data type struct stat to store the attribute structure (i.e. statBuff) d. Declare a variable of data type int to store an error code (i.e. err) e. Declare a variable of data type struct dirent as a pointer (i.e. de) f. Declare a variable of data type DIR as a pointer set equal to function call opendir() passing explicit text “.” as an argument to indicate the current directory (i.e. dr) g. If the DIR variable is equal to NULL do the following i. Output to the…arrow_forwardCode in C language. Please provide code for 3 different files. One header file and two .C files. I need the code for each file. Please provide photos of the output and source code for each file (3). Please follow All instructions in the photo provided. Use the provided input.txt file provided below. A1, A2 20294 Lorenzana Dr Woodland Hills, CA 91364 B1, B2 19831 Henshaw St Culver City, CA 94023 C1, C2 5142 Dumont Pl Azusa, CA 91112 D1, D2 20636 De Forest St Woodland Hills, CA 91364 A1, A2 20294 Lorenzana Dr Woodland Hills, CA 91364 E1, E2 4851 Poe Ave Woodland Hills, CA 91364 F1, F2 20225 Lorenzana Dr Los Angeles, CA 91111 G1, G2 20253 Lorenzana Dr Los Angeles, CA 90005 H1, H2 5241 Del Moreno Dr Los Angeles, CA 91110 I1, I2 5332 Felice Pl Stevenson Ranch, CA 94135 J1, J2 5135 Quakertown Ave Thousand Oaks, CA 91362 K1, K2 720 Eucalyptus Ave 105 Inglewood, CA 89030 L1, L2 5021 Dumont Pl Woodland Hills, CA 91364 M1, M2 4819 Quedo Pl Westlake Village, CA 91362 I1, I2 5332 Felice Pl…arrow_forwardC++Create a text file storage for the list of movies and store your those movies in a linked list when you retrieved them from the text file. They must also be stored in a linked list data structure during processing. Saving back to the text file will be done when the user chooses to Exit the Program.arrow_forward
- 1 Goals Use C++ to read data from a text file and create an array of numbers. Use the C++ 'fstream' library functions to open, read and close a text file. You can use the C++ 'iomanip' library to format your output and manage whitespace on your input. Graduate students must create and write the data to a new text file. 2 Your assignment is to create a program that does the following: a. You will need to create a new file (you can do this in the file system – make it plain text) and call it mydata.txt. b. Put a column of numbers in the text file to read later. Pay attention to type – make them all have decimal points. In repl.it, use the numbers in my file. c. Based on the examples in the slides (L3) and the textbook, write a C++ program, include 'iostream' and 'fstream'. You might need 'iomanip'. d. Your program should read the numbers from the file into an array and print the array to the console in reverse order using a for loop. e. Graduate Students must also print the output to a…arrow_forwardIn C++ I am opening a file through a command argument and reading through it. How do you write to the file that would be opened?arrow_forwardThe template shown below must be incorporated into the code showed after the template Template: // -- brief statement as to the file’s purpose //XXX XXX- ADD YOUR SECTION NUMBER //Include statements #include #include using namespace std; //Global declarations: Constants and type definitions only -- no variables //Function prototypes int main() { //In cout statement below SUBSTITUTE your name and lab number cout << "Your name -- Lab Number" << endl << endl; //Variable declarations //Program logic //Closing program statements system("pause"); return 0; } //Function definitions Code: #include<iostream>#include <iomanip> using namespace std; //function prototypesfloat convToFeet(float, float, float); //main functionint main() {// variable declarationchar woodType;float totalCharge = 0.0, eachCost = 0.0, woodWidth, woodHeight, woodLength;;int noOfpc;cout << setprecision(2) << fixed; //infinite loop until it obtains the character 'T'do{cout…arrow_forward
- In C++, how do you encrypt one character in a file read into the code?arrow_forwardHow do I do this C programming question?arrow_forwardPython 3 Given that a variable named pathName contains a string describing a directory path, write a single Python statement that will store the names of all files and subdirectories in that path in a List structure named contents. DO NOT traverse the path/directory. You are only interested in the immediate path and its contents. You may assume that any necessary import statements already exist.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education