Answer:
In C++:
#include <iostream>
using namespace std;
int main(){
string fname,lname; int num;
cout<<"Firstname: "; cin>>fname;
cout<<"Lastname: "; cin>>lname;
cout<<"4 digits: "; cin>>num;
string login = lname;
if(lname.length()>=5){
login = lname.substr(0, 5); }
login+=fname.substr(0,1)+to_string(num%100);
cout<<login;
return 0;
}
Explanation:
See attachment for explanation where I used comments to explain each line
Answer:
no_of_shares = int(input("Enter the number of shares: "))
purchase_price = float(input("Enter the purchase price of the stock: "))
sale_price = float(input("Enter the sale price of the stock: "))
total_stock_price = purchase_price*no_of_shares
total_spend_on_buying = total_stock_price + (0.03*total_stock_price)
total_sale_price = sale_price*no_of_shares
commission_while_selling = total_sale_price*0.03
net_gain_or_loss = total_sale_price - (total_spend_on_buying + commission_while_selling)
if(net_gain_or_loss<0):
print("After the transaction, you lost {} dollars".format(abs(net_gain_or_loss)))
else:
print("After the transaction, you made {} dollars".format(abs(net_gain_or_loss)))
Answer:
c. open the file, read/write/save data, close the file
Explanation:
Details view provides the most information at a glance.
<h3>Which view in File Explorer can you use to sort files by column heading?</h3>
In Explorer windows, files and folders appear in lists with headings at the top in Details view. You can use the headings to change how files are displayed in the window. You can use filtering and sorting to display the files and folders you want.
<h3>What is the command to display the list of files in a directory?</h3>
Use the ls command to display the contents of a directory. The ls command writes to standard output the contents of each specified Directory or the name of each specified File, along with any other information you ask for with the flags.
To learn more about Details view, refer
brainly.com/question/24858866
#SPJ4