More Practice Problems#
Bash shell#
You do an
lsin a directory and see the following:Castro_sdc.cpp Castro_sdc_util.H sdc_newton_solve.H sdc_util.cpp Castro_sdc.H Make.package sdc_react_util.H vode_rhs_true_sdc.H
What is a wildcard pattern that matches all of the
.cppfiles?What is a wildcard pattern that matches all of the files that start with
sdcand end in.H?
You can to store the history of commands you typed in the Bash shell to a file called
session.txt. How could you do this?You want to create a file called
hello.cppon theportalmachine, what is the command for a text editor that you can use?What is the difference between the
mvcommand and thecpcommand?
C++ basics#
What is the difference between the following 2 declarations?
int a{1.5}; double a{1.5};
We want to compute \(e^x\), for \(x = 2.0\) and output the result to the screen. Give the entire program that does this.
Are these two expressions different when computed?
y = a + (b * -c);
y = a + b * -c;
For a variable
xthat isdouble, what is the meaning of this line:x += 2.0;