In this assignment we are going to practice reading from a file and writing the results of your program into a file. We are going to write a program to help Professor X automate the grade calculation for a course. Professor X has a data file that contains one line for each student in the course. The students name is the first thing on each line, followed by some tests scores. The number of scores might be different for each student. Here is an example of what a typical data file may look like: Joe 10 15 20 30 40 Bill 23 16 19 22 Sue 8 22 17 14 32 17 24 21 2 9 11 17 Grace 12 28 21 45 26 10 John 14 32 25 16 89 Program details Write a program that: Ask the user to enter the name of the data file. Read the data from the file and for each student calculate the total of the test scores, how many tests the student took, and the average of the test scores. Save the results in an output file (e.g. stats.txt) in the following order: studentName totalScore numberOfTests testAverage Note that the average is saved with 2 decimal places after the decimal point. Validation: Make sure your program does not crash if a file is not found or cannot be open.

Answers

Answer 1

Answer:

In Python:

import os.path

from os import path

fname = input("Filename: ")

if path.exists(fname):

with open(fname) as file_in:

 lines = []

 for line in file_in:

  lines.append(line.rstrip('\n'))

f = open("stat.txt","r+")

f.truncate(0)

f = open("stat.txt", "a")

f.write("Names\tTotal\tSubjects\tAverage\n")

for i in range(len(lines)):

 rowsum = 0; count = 0

 nm = lines[i].split()

 for j in nm:

  if (j.isdecimal()):

   count+=1

   rowsum+=int(j)

 average = rowsum/count

 f.write(nm[0]+"\t %3d\t %2d\t\t %.2f\n" % (rowsum, count, average))

f.close()

else:

print("File does not exist")

Explanation:

See attachment for explanation where comments were used to explain each line

Answer 2

For each student, the sum of the marks, total tests were taken and the average of marks is calculated and is stored in an output file, for example, stats.txt.

Python Code:

The code in Python asks the user for an input file name. If the input file is not found an error is printed else the data in the file is processed further.

Try:

  # take input file name

  file = input('Enter name of the data file: ')

# open the input file

  ip = open(file, 'r')

# store the lines from input file in a list

  lines = ip.readlines()

  # close the file

  ip.close()

# open the output file

  op = open('stats.txt', 'w')

# iterate over each line

  for line in lines:

 # split data using space as delimiter

      data = line.split()

 # get name

   name = data[0]

 # get marks and convert them to integer

      marks = list(map(int, data[1:]))

# get sum of marks

      total = sum(marks)

# get number of tests

      length = len(marks)

# calculate average of marks

      avg = total/length

# add the data to output file

      op.write('{} {} {} {:.2f}\n'.format(name, total, length, avg))

# close the output file

  op.close()

print('Stats have been save in the output file')

# catch FileNotFoundError

except FileNotFoundError:

# print error

  print('Error: that file does not exist. Try again.')

Learn more about the topic python code:

https://brainly.com/question/14492046


Related Questions

Arrange the computers in the order fastest to slowest: Minicomputer, Supercomputer, Personal Computer and Mainframe.

Answers

Answer:

supercomputer, mainframe, personal computer, minicomputer

Explanation:

g Create a program that prompts a user to enter a login name and password. The correct login name is Admin, and the correct password is PASS. If both login name and password are correct, display Correct Loginto the console window. If the login name or password is wrong, display what is wrong to the console window. For example, wrong username, wrong password, or both. program in C

Answers

Answer:

Answered below.

Explanation:

//Program in Python

login_name = "Admin"

password = "PASS"

display = " "

user_login_name = input ("Enter username: ")

user_password = input("Enter your Password: ")

if user_login_name == login_name and user_password == password:

display = "Correct Login"

elif user_login_name != login_name:

display = "wrong username"

elif user_password != password:

display = "wrong password"

print(display)

Why do people make Among Us games on Ro-blox, and thousands of people play them, when Among Us is free on all devises?
A) Maybe they think the Ro-blox version is better???
B) They don't know it's on mobile. Nor do they know it's free.
C) I have no idea.
D) I agree with C).

Answers

Hellooo Marie Here!!

I think its A) Maybe they think the Ro-blox version is better

Plus, Among Us isn't  free on all devices. (like PC)

And, to be honest I like the normal Among Us better than the Ro-blox version...

Hope This Helps! Have A GREATTT Day!!

Plus, Here's an anime image that might make your day happy:

Which story element refers to the way the story unfolds?
A.
premise
B.
back story
C.
synopsis
D.
plot

Answers

Answer:

D. Plot

Explanation:

The plot is how the story develops, unfolds and move through time.

Complete the function favoriteFlower(). Note that the program will not run as is because the function is incomplete. The purpose of the function is to determine if the given flower is in the top three of my favorite flowers. The starter file defines a list of favorite flowers that is ordered most favorite to least favorite. Please pass the flower name and the flower list as arguments in the function. The expected output is:

Answers

Answer:

What Language? Once you respond with a comment, I will be happy to write the code for you. I write code 24/7 (Because I have nothing better to do), so I will wait for you to comment. Also is there any pre-existing code?

Explanation:

Write a program that asks the user to guess the next roll of a six-sided die. Each guess costs $ 1. If they guess correctly, they get $ 100.00. The player will start out with a $10.00 bank. Each time he (or she) guesses incorrectly you will subtract $1.00 from their bank. Each time they guess correctly, you add $10.00 to their bank. Print the total winnings or losses at the end of the game. You can simulate the toss of the dice using the RandomRange function (Don't forget to Randomize).

Answers

Answer in python:

import random

money = 10

winnings = 0

def main():

global winnings

global money

dice_num = random.randrange(1,6)

input_str = "Guess the dice number. You have $"+str(money)+" > "

input_num = input(input_str)

if int(input_num) == dice_num:

 money = money + 10

 winnings = winnings + 10

else:

 money = money - 1

if money < 0:

 print("You lose. You won "+str(winnings)+" times. Press enter to try again")

 useless_variable = input()

 main()

else:

 main()  

main()

Explanation:

You were hired as a systems analyst by a small independent publishing firm. This firm has been specialized in paperback books, and now thinking of publishing most of their paperback books online. As a systems analyst, you are expected to help develop a computerized inventory and distribution information system, and lead the whole project. With the new strategic objective, you will also develop a solution that will help the firm convert paperbacks to e-books. In your first month, you are expected to be familiar with the firm and the market including competitors and collaborators across the supply chain. You also need to start communicating with internal and external stakeholders to elicit the requirements. Besides, the firm is planning to open new branches in different states and cities, and renew its website on which books are advertised and sold. You are thinking of implementing an agile methodology (iterative and incremental) to plan, design, and implement the information systems. As a systems analyst, you will determine requirements.

Required:
Explain how you will ensure continual user involvement.

Answers

Answer:

To ensure continual user involvement, I will employ a user-centered design system.

This system requires that I gather data from users and incorporate findings into the inventory systems design.  The purpose is to create user-friendly inventory  and information distribution systems.

To achieve this, I will try to understand the users of the systems, the users' tasks, and the users' work environments.  Then, I will evaluate the user requirements based on current and future needs.  I will address the user requirements and continuously involve the user in the design and development of the systems.

Explanation:

The deployment of user-centric design is to achieve project success.  Using this approach will also save design and development time, cut design and development costs, and improve user satisfaction.  This approach will also help me to understand the user needs and requirements and help the users to understand the newly developed systems.

what is the correct process for setting up a recurring project for the same client in qbo accountant?

Answers

Answer:

The answer is below

Explanation:

The correct process for setting up a recurring project for the same client in Quickbooks Online Accountant is as follows:

1. Go to Work, then select create a project

2. Select the Repeat button, then set the frequency and duration

3. Formulate the project and save it.

4. Reopen the project

5. And select the Duplicate button for the proportion of times you want it to recur. This includes assigning the interval, day of the recurrence, and end time.

6. Then select Save.

Firstly, invent a separate project, then pick the repeat button on the right of the screen, specify the frequency and duration. Its frequency can indeed be weekly, biweekly, monthly, and so on.

This project's duration must be determined. This step saves the user time when working on a project. Otherwise, the same actions would have to be done again and over, which would be time-consuming and repetitive.New project and click the continue option to start the process of preparing a recurring project for the same client.This second alternative is not the best method to create a recurring project for the same client. Based on the phase, the initiatives can be generated as many times as necessary.

Therefore, the answer is "first choice".

Learn more:

brainly.com/question/24356450

why must a satellite have distinct uplink and downlink frequencies.​

Answers

Answer:

The reason that a satellite must have a distinct uplink and downlink set of frequencies is because they help avoid any type of interference that may occur. The uplink receives the signal and amplifies it so that it can be transmitted to another frequency (downlink).

- A blacksmith is shoeing a miser's horse. The blacksmith charges ten dollars for his work. The miser refuses to pay. "Very well", says the blacksmith, "there are eight nails in each horseshoe. The horse has four shoes. There are 32 nails in all. I will ask you to pay one penny for the first nail, two pennies for the next nail, four pennies for the next nail, eight pennies for the next nail, sixteen pennies for the next, etc. until the 32nd nail". How much does the miser have to pay?​

Answers

Answer:

1+ 2^31= 2,146,483,649 pennies.

in Dollars- $21,464,836.49

edit for total=

42, 929,672. 97

Explanation:

,


Which of the following can technology NOT do?
O Make our life problem free
O Provide us with comforts and conveniences
Help make our lives more comfortable
O Give us directions to a destination

Answers

make our life problem free

because technology has its negative effects on humanity like Social media and screen time can be bad for mental health

And technology is leading us to sedentary lifestyles

Technology is addictive

Insomnia can be another side effect of digital devices

Instant access to information makes us less self-sufficient

Young people are losing the ability to interact face-to-face

Social media and screen time can be bad for mental health

Young people are losing the ability to interact face-to-face

Relationships can be harmed by too much tech use

Write a C++ program to calculate the course score of CSC 126. 1. A student can enter scores of 3 quizzes, 2 exams, and a final exam. The professor usually keeps 1 digit after the point in each score but the overall course score has no decimal places. 2. The lowest quiz score will not be calculated in the quiz average. 3. The weight of each score is: quiz 20%, exams 30%, and the final 50%. 4. The program will return the weighted average score and a letter grade to the student. 5. A: 91 - 100, B: 81 - 90, C: 70 - 80, F: < 70.

Answers

Answer:

In C++:

#include <iostream>

using namespace std;

int main(){

   double quiz1, quiz2, quiz3, exam1, exam2, finalexam,quiz;

   cout<<"Quiz 1: "; cin>>quiz1;

   cout<<"Quiz 2: "; cin>>quiz2;

   cout<<"Quiz 3: "; cin>>quiz3;

   cout<<"Exam 1: "; cin>>exam1;

   cout<<"Exam 2: "; cin>>exam2;

   cout<<"Final Exam: "; cin>>finalexam;

   if(quiz1<=quiz2 && quiz1 <= quiz3){        quiz=(quiz2+quiz3)/2;    }

   else if(quiz2<=quiz1 && quiz2 <= quiz3){        quiz=(quiz1+quiz3)/2;    }

   else{         quiz=(quiz1+quiz2)/2;     }

   int weight = 0.20 * quiz + 0.30 * ((exam1 + exam2)/2) + 0.50 * finalexam;

   cout<<"Average Weight: "<<weight<<endl;

   if(weight>=91 && weight<=100){        cout<<"Letter Grade: A";    }

   else if(weight>=81 && weight<=90){        cout<<"Letter Grade: B";    }

   else if(weight>=70 && weight<=80){        cout<<"Letter Grade: C";    }

   else{        cout<<"Letter Grade: F";    }

   return 0;

}

Explanation:

See attachment for complete program where comments were used to explain difficult lines

For this program you will build a simple dice game called Pig. In this version of Pig, two players alternate turns. Players each begin the game with a score of 0. During a turn a player will roll a six-sided die one or more times, summing up the resulting rolls. At the end of the player's turn the sum for that turn is added to the player's total game score If at any time a player rolls a 1, the player's turn immediately ends and he/she earns O points for that turn (i.e. nothing is added to the player's total game score). This is called "pig". After every roll that isn't a 1, the player may choose to either end the turn, adding the sum from the current turn to his/her total game score, or roll again in an attempt to increase the sum. The first player to 50 points wins the game
Details
Open a text editor and create a new file called pig.py. In the file
Write a function called print_scores that has four parameters - these hold, in this order, the name of the first player (a string), his/her score (an int), the second player's name (a string), and score (an int).
The function will
Print the following message, using the current parameter values for the player names and scores (NOT necessarily Ziggy, 18, Elmer, and 23) -SCORES Ziggy:18 Elmer 23--
Print an empty line before this line
There is a single tab between SCORES and the name of player 1 .
There is a single tab between player 1's score and player 2's name .
Every other gap is a single space

Answers

Answer:

In Python:

import random

p1name = input("Player 1: "); p2name = input("Player 2: ")

p1score = 0; p2score = 0

playerTurn = 1

print(p1name+" starts the game")

roll = True

while(roll):

   if playerTurn == 1:

       p1 = random.randint(1,6)

       print(p1name+"'s roll: "+str(p1))

       if p1 == 1:

           playerTurn = 2

           roll = True

       else:

           p1score+=p1

           another = input("Another Roll (y/n): ")

           if another == "y" or another == "Y":

               roll = True

           else:

               playerTurn = 2

               roll = True

   else:

       p2 = random.randint(1,6)

       print(p2name+"'s roll: "+str(p2))

       if p2 == 1:

           playerTurn = 1

           roll = True

       else:

           p2score+=p2

           another = input("Another Roll (y/n): ")

           if another == "y" or another == "Y":

               roll = True

           else:

               playerTurn = 1

               roll = True

   if p1score >= 50 or p2score >= 50:

       roll = False

print(p1name+":\t"+str(p1score)+"\t"+p2name+":\t"+str(p2score))

Explanation:

Note that the dice rolling is simulated using random number whose interval is between 1 and 6

This imports the random module

import random

This line gets the name of both players

p1name = input("Player 1: "); p2name = input("Player 2: ")

This line initializes the scores of both players to 0

p1score = 0; p2score = 0

This sets the first play to player 1

playerTurn = 1

This prints the name of player 1 to begin the game

print(p1name+" starts the game")

This boolean variable roll is set to True.

roll = True

Until roll is updated to False, the following while loop will be repeated

while(roll):

If player turn is 1

   if playerTurn == 1:

This rolls the dice

       p1 = random.randint(1,6)

This prints the outcome of the roll

       print(p1name+"'s roll: "+str(p1))

If the outcome is 1, the turn is passed to player 2

       if p1 == 1:

           playerTurn = 2

           roll = True

If otherwise

       else:

Player 1 score is updated

           p1score+=p1

This asks if player 1 will take another turn

           another = input("Another Roll (y/n): ")

If yes, the player takes a turn. The turn is passed to player 2, if otherwise

           if another == "y" or another == "Y":

               roll = True

           else:

               playerTurn = 2

               roll = True

If player turn is 2

   else:

This rolls the dice

       p2 = random.randint(1,6)

This prints the outcome of the roll

       print(p2name+"'s roll: "+str(p2))

If the outcome is 1, the turn is passed to player 1

       if p2 == 1:

           playerTurn = 1

           roll = True

If otherwise

       else:

Player 2 score is updated

           p2score+=p2

This asks if player 2 will take another turn

           another = input("Another Roll (y/n): ")

If yes, the player takes a turn. The turn is passed to player 1, if otherwise

           if another == "y" or another == "Y":

               roll = True

           else:

               playerTurn = 1

               roll = True

If either of both players has scored 50 or above

   if p1score >= 50 or p2score >= 50:

roll is updated to False i.e. the loop ends

       roll = False

This prints the name and scores of each player

print(p1name+":\t"+str(p1score)+"\t"+p2name+":\t"+str(p2score))

Formatting commands can be used to add number formats? True of false

Answers

Answer:

false

Explanation:

Write the function evens which takes in a queue by reference and changes it to only contain the even elements. That is, if the queue initially contains 3, 6, 1, 7, 8 then after calling odds, the queue will contain 6, 8. Note that the order of the elements in the queue remains the same. For full credit, no additional data structures (queues, stacks, vectors, etc.) should be used. Assume all libraries needed for your implementation have already been included.

Answers

Answer:

Explanation:

The following code is written in Java it goes through the queue that was passed as an argument, loops through it and removes all the odd numbers, leaving only the even numbers in the queue. It does not add any more data structures and finally returns the modified queue when its done.

  public static Queue<Integer> evens(Queue<Integer> queue) {

       int size = queue.size();

       for(int x = 1; x < size+1; x++) {

           if ((queue.peek() % 2) == 0) {

               queue.add(queue.peek());

               queue.remove();

           } else queue.remove();

       }

       return queue;

   }

Describe how to add images and shapes to a PowerPoint
presentation
In this assignment, you will describe how to add images and shapes to a PowerPoint presentation

Answers

For shapes:

Step .1: Open Power point

Step.2: Go to insert

Step.3: Click at shapes

Step.4: Pick your shape

For image :

If you are trying for an random image not saved at your pc

Step.1: Open Power point

Step.2: Go to insert

Step.3: Click at clip art

Step.4: Type the name of the picture you are searching for.

"OR"

If you are trying for an image you have in your pc

Step.1: Open PowerPoint

Step.2: Go to insert

Step.3: Click photo album

Step.4: Choose the picture

Hope it helped you

THANKYOU !

Create an application that will be used to monitor the number of manatees in a given waterway in C#

Answers

Answer:

u can use water for washing of hands and also drinking of water

ROCK-PAPER-SCISSORS Write a program that plays the popular game of rock-paper-scissors. (A rock breaks scissors, paper covers rock, and scissors cut paper). The program has two players and prompts the users to enter rock, paper or scissors. Your program does not have to produce any color. The color is there just to show you what your program should be inputting and outputting. The writing in blue represents output and writing in red represents input. Here are some sample runs:

Answers

Answer:

In Python

print("Instruction: 1. Rock, 2. Paper or 3. Scissors: ")

p1 = int(input("Player 1: "))

p2 = int(input("Player 2: "))

if p1 == p2:

   print("Tie")

else:

   if p1 == 1: # Rock

       if p2 == 2: #Paper

           print("P2 wins! Paper covers Rock")

       else: #Scissors

           print("P1 wins! Rock smashes Scissors")

   elif p1 == 2: #Paper

       if p2 == 1: #Rock

           print("P1 wins! Paper covers Rock")

       else: #Scissors

           print("P2 wins! Scissors cuts Paper")

   elif p1 == 3: #Scissors

       if p2 == 1: #Rock

           print("P2 wins! Rock smashes Scissors")

       else: #Paper

           print("P1 wins! Scissors cuts Paper")

Explanation:

This prints the game instruction

print("Instruction: 1. Rock, 2. Paper or 3. Scissors: ")

The next two lines get input from the user

p1 = int(input("Player 1: "))

p2 = int(input("Player 2: "))

If both input are the same, then there is a tie

if p1 == p2:

   print("Tie")

If otherwise

else:

The following is executed if P1 selects rock

   if p1 == 1: # Rock

If P2 selects paper, then P2 wins

       if p2 == 2: #Paper

           print("P2 wins! Paper covers Rock")

If P2 selects scissors, then P1 wins

       else: #Scissors

           print("P1 wins! Rock smashes Scissors")

The following is executed if P1 selects paper

   elif p1 == 2: #Paper

If P2 selects rock, then P1 wins

       if p2 == 1: #Rock

           print("P1 wins! Paper covers Rock")

If P2 selects scissors, then P2 wins

       else: #Scissors

           print("P2 wins! Scissors cuts Paper")

The following is executed if P1 selects scissors

   elif p1 == 3: #Scissors

If P2 selects rock, then P2 wins

       if p2 == 1: #Rock

           print("P2 wins! Rock smashes Scissors")

If P2 selects paper, then P1 wins

       else: #Paper

           print("P1 wins! Scissors cuts Paper")

In ……………cell reference, the reference of a cell does not change. ​

Answers

Answer:

In absolute cell reference, the reference of a cell does not change. 

write a BASIC program to find the product of any two numbers​

Answers

Answer:

Print 4 + 4

Explanation:

If you're writing this in the programming language called BASIC, this is how you would add any two numbers.

The following pseudocode describes how a bookstore computes the price of an order from the total price and the number of the books that were ordered. Step 1: read the total book price and the number of books. Step 2: Compute the tax (7.5% of the total book price). Step 3: Compute the shipping charge ($2 per book). Step 4: The price of the order is the sum of the total book price, the tax and the shipping charge. Step 5: Print the price of the order. Translate this psuedocode into a C Program. Please write only the main body of the program

Answers

Answer:

float bookExamplePrice = 15.25;

float bookTax = 7.5;

float bookShippingPrice = 2.0;

float Test = bookExamplePrice / 100;

float Tax = Test * bookTax;

float FullPrice = Tax + bookExamplePrice + bookShippingPrice;

// I don't know how to remove the numbers after the first two decimals.

// I tested this program. It works!

// The text after the two slashes don't run when you compile them.

printf("Price: $%.6f\n",FullPrice);

Explanation:

1. What is the difference between computer organization and computer architecture? 2. What is an ISA? 3. What is the importance of the Principle of Equivalence of Hardware and Software? 4. Name the three basic components of every computer. 5. To what power of 10 does the prefix giga- refer? What is the (approximate) equivalent power of 2? 6. To what power of 10 does the prefix micro- refer? What is the (approximate) equivalent power of 2?

Answers

Answer:

1.Computer Organization is how operational parts of a computer system are linked together. Computer architecture provides functional behavior of computer system. ... Computer organization provides structural relationships between parts of computer system.

2. An ISA, or Individual Savings Account, is a savings account that you never pay any tax on. It does come with one restriction, which is the amount of money you can save or invest in an ISA in a single tax year – also known as your annual ISA allowance.

3. The principle of equivalence of hardware and software states that anything that can be done with software can also be done with hardware and vice versa. This is important in designing the architecture of a computer. There are probably uncountable choices to mix and match hardware with software.

4.Computer systems consist of three components as shown in below image: Central Processing Unit, Input devices and Output devices. Input devices provide data input to processor, which processes data and generates useful information that's displayed to the user through output devices.

5.What is the (approximate) equivalent power of 2? The prefix giga means 109 in the SI (International System of Units) of decimal system. Now convert to binary definition. So, the 1 giga =230 bytes.

1 #include 2 3 int max2(int x, int y) { 4 int result = y; 5 if (x > y) { 6 result = x; 7 } 8 return result; 9 } 10 11 int max3(int x, int y, int z) { 12 return max2(max2(x,y),z); 13 } 14 15 int main() { 16 int a = 5, b = 7, c = 3; 17 18 printf("%d\n",max3(a, b, c)); 19 20 printf("\n\n"); 21 return 0; 22 } What number is printed when the program is run?

Answers

Answer:

7

Explanation:

#include <stdio.h>

int max2(int x, int y) {

   int result = y;

   if (x > y) {

       result = x;

   }

   return result;

}

int max3(int x, int y, int z) {

   return max2(max2(x,y),z);

}

int main() {

   int a = 5, b = 7, c = 3;

   printf("%d",max3(a, b, c));

   printf("");

   return 0;

}

Hi, first of all, next time you post the question, it would be nice to copy and paste like above. This will help us to read the code easily. Thanks for your cooperation.

We start from the main function:

The variables are initialized → a = 5, b = 7, c = 3

max3 function is called with previous variables and the result is printed → printf("%d",max3(a, b, c));

We go to the max3 function:

It takes 3 integers as parameters and returns the result of → max2(max2(x,y),z)

Note that max2 function is called two times here (One call is in another call actually. That is why we need to first evaluate the inner one and use the result of that as first parameter for the outer call)

We go to the max2 function:

It takes 2 integers as parameters. If the first one is greater than the second one, it returns first one. Otherwise, it returns the second one.

First we deal with the inner call. max2(x,y) is max2(5,7) and the it returns 7.

Now, we need to take care the outer call max2(7, z) is max2(7, 3) and it returns 7 again.

Thus, the program prints 7.

create java program for these 2 question

Answers

1 see what you can do and go from their

A low price point is an example of a ________. Choose one.

Answers

Answer:

of a bad product

Explanation:

Which of the following is a/are view/views to display a table in Access?
Question 5 options:


Datasheet view


Design view


Both A and B


None of the above

Answers

Answer:Both A and B

Explanation:

3.26 LAB: Login name Write a program that creates a login name for a user, given the user's first name, last name, and a four-digit integer as input. Output the login name, which is made up of the first five letters of the last name, followed by the first letter of the first name, and then the last two digits of the number (use the % operator). If the last name has less than five letters, then use all letters of the last name. Hint: Use the to_string() function to convert numerical data to a string. Ex: If the input is: Michael Jordan 1991 the output is: Your login name: JordaM91 Ex: If the input is: Kanye West 2024 the output is: Your login name: WestK24

Answers

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:

This declares the first name, last name as strings and 4 digit number as integer

   string fname,lname; int num;  

This prompts and get input for last name

cout<<"Firstname: "; cin>>fname;

This prompts and get input for first name

   cout<<"Lastname: "; cin>>lname;

This prompts and get input for four digit number

   cout<<"4 digits: "; cin>>num;

This initializes login information to last name

   string login = lname;

This checks if length of login is 5 and above

   if(lname.length()>=5){

If yes, it gets the first five letters only

       login = lname.substr(0, 5);    }

This adds the first character of first name and the last 2 digits of num to login

   login+=fname.substr(0,1)+to_string(num%100);

This prints the login information

   cout<<login;

In order to restrict editing to a document, a user will go to Review, , Restrict Editing, and will then select what kinds of editing are allowed.

Answers

Answer: drafting

Explanation:

______________ is a raw fact about a person or an object
Question 1 options:


File


Lookup wizard


Information


Data

Answers

I think its C information. Sowwy if I’m wrong

Which is the best example of a digital leader sharing information?

Nina creates a budget spreadsheet and e-mails it to her boss before a meeting.
Erick conducts a survey on a street corner and copies his notes for his boss.
Rehana buys a newspaper ad and asks people to text ideas to her boss.
Fernando draws a blueprint at a meeting and e-mails his boss about it.

Answers

Answer: Nina creates a budget spreadsheet and e-mails it to her boss before a meeting.

Explanation:

It's right

Answer:

a

Explanation:

Other Questions
Which sentence correctly uses an adjectival phrase ?A) Kathryn selected a sweater with a bold zigzag pattern.B) Kathryn slowly and carefully selected a sweater. C) Kind, gentle, Kathryn selected a sweater.D) We went to the store, and Kathryn selected a sweater. Areas in Mexico and Central America are known as In triangle ABC, the measure of angle CAB is 80 and the measure of angle ABC is 45.5. What is the measure of angle BCA in degrees?A 125.5B 54.5C 55.5D 64.5 Fifty people put there nameinto a two different drawings(30 males and 20 females).One drawing is for an iPad andthe other is for a flat screenTV. What is the probabilitythat a female will win the iPadand a male win the flatscreen?7.SP.8 HELP ASAP ILL GIVE BRAINLIESTWrite an expression forThe product of eleven times a number less than 1211(n - 12)12n - 1111n - 1212 - 11n 3x+4=25 please this will help alot Describe the zeros of the graphed function.A. The function has three distinct real zeros.B. The function has two distinct real zeros and two complex zeros.C. The function has four distinct real zeros.D. The function has one distinct real zero and two complex zeros. Yall I need help!! Help pls ASAP ILL MARK BRAINLIEST ANYONE PLSGiven the quote and the art piece we just viewed, what kind of character do you predict King Arthur to be, and why?"The memory of King Arthur, that most renowned King of the Britons, will enduure for ever..." This graph represents a linear function.Enter an equation in the form y=mx+b that represents the functiondescribed by the graph.*Note: Uses only numbers and symbols, no spaces. If there is a fraction,101make it improper and use parentheses (ie. y =72+ z will be typedas y=(10/7)x+(1/2)]Type your answer I dont understand can someone please help. Which statement best explains how the use of popular music can persuade a young audience? DUE soon! For an unknown parent function f(x), write a function g(x) that is:vertically stretched by a factor of 2,shifted up 5 units, andshifted right 4 units.Explain how your function accomplishes these transformations. See I don't know if you can choose whichever parent function to start off. What were the Northern and Southern reactions to John Browns raid on Harpers Ferry? What is the difference of (Three-fourths x minus two-thirds) minus (Negative StartFraction 5 over 6 EndFraction + 2 x)? the top of a table has a length of 7 feet and a width of 5 feet. what is the area of the table top Which creative work would have reflected typical American themes in the mid-1800s? O A. A play in which a group of people leaves the United States for Europe OB. A poem about the cycle of life and death through the seasons C. An abstract painting of bright colors and straight lines D. A film in which a young boy must train his new dog what are the indicators of development plz help me il giv a lot of points How many 0.5 ribbons will be cut from a 8 meter