1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
tresset_1 [31]
3 years ago
8

Pomógłbymi ktoś z takim zadaniem? C++

Computers and Technology
1 answer:
Elenna [48]3 years ago
8 0

#include <iostream>

using namespace std;

int main(int argc, char** argv) {

 

int n;

cout<<"Podaj n: ";

cin>>n;

 

int **tab=new int *[n];

 

for(int i=0;i<n;i++){

 tab[i]=new int [n];

}

 

for (int l=0;l<n;l++){

 for(int j=0;j<n;j++){

  if(j==l || n-l-1==j) tab[l][j]=0;

  else tab[l][j]=1;

 }

}

 

 for (int i=0;i<n;i++){

 for(int j=0;j<n;j++){

 cout<<tab[i][j];

 }

 cout<<"\n";

}

 

for(int i=0;i<n;i++){

  delete [] tab[i];

}

delete [] tab;

return 0;

}

Siema Marcin tak wgl.

You might be interested in
All of the following are examples of roadblocks to achieving a goal except
Volgvan
Having to many goals
6 0
3 years ago
Read 2 more answers
Which pair of Information Technology career fields may require work to be done outside of normal office hours? interactive media
scZoUnD [109]

Answer:

The answer to this question is "information services and support and network system administration".

Explanation:

The information support and service and network system administration is used to outside work, which can be explained as follows:  

  • The information support and service process is using information processing that is defined as the system for record-keeping, forms, figures and data in a business.  
  • A network or device system administrators are responsible for the day-to-day deployment of all these networks. They arrange, restore, and promote the computer systems of the company, which include local area networks, WANs, system sections, web services, and other wireless communication systems. The system provides local area networks.

6 0
3 years ago
Read 2 more answers
The Account class contains a definition for a simple bank account class with methods to withdraw, deposit, get the balance and a
melamori03 [73]

Answer:

I've updated the Account class as per the instructions. The instructions mention "the constructor for this class creates a random account number" although I didn't find where that was. As a result, I created a simple method to generates the account number (located at the bottom of the class). Be sure you understand the changes (highlighted in yellow) and feel free to ask follow-up questions:

Explanation:

//*******************************************************

// Account.java

//

// A bank account class with methods to deposit to, withdraw from,

// change the name on, and get a String representation

// of the account.

//*******************************************************

import java.util.Random;   // Used for Random # generator

public class Account

{

      private double balance;

  private String name;

     private long acctNum;

      //----------------------------------------------

 //Constructor -- initializes balance, owner, and account number

  //----------------------------------------------

 public Account(double initBal, String owner, long number)

{

        balance = initBal;

               name = owner;

            acctNum = number;

}

// !!!!!! New Constructor !!!!!!

public Account(double initBal, String owner)

     {

        balance = initBal;

               name = owner;

            acctNum = generateAccountNumber();

       }

  // !!!!!! New Constructor !!!!!!

 public Account(String owner)

     {

        balance = 0;

             name = owner;

            acctNum = generateAccountNumber();

       }

   //----------------------------------------------

 // Checks to see if balance is sufficient for withdrawal.

// If so, decrements balance by amount; if not, prints message.

  //----------------------------------------------

 public void withdraw(double amount)

      {

        if (balance >= amount)

                balance -= amount;

               else

                     System.out.println("Insufficient funds");

}

 // !!!!!! New withdraw() method !!!!!!

   public void withdraw(double amount, double fee)

  {

        double amountWithFee = amount + fee;

               if (balance >= amountWithFee)

                 balance -= amountWithFee;

        else

                     System.out.println("Insufficient funds");

}

   //----------------------------------------------

 // Adds deposit amount to balance.

       //----------------------------------------------

 public void deposit(double amount)

       {

        balance += amount;

       }

  //----------------------------------------------

 // Returns balance.

      //----------------------------------------------

 public double getBalance()

       {

        return balance;

  }

    //----------------------------------------------

 // Returns a string containing the name, account number, and balance.

    //----------------------------------------------

 public String toString()

 {

        return "Name:" + name +

          "\nAccount Number: " + acctNum +

         "\nBalance: " + balance;

 }

 // !!!! NEW PRIVATE HELPER METHOD TO GENERATE ACCOUNT NUMBERS !!!!!

//-------------------------------------------------------

// Returns a random account number between 10000 - 99999

 //--------------------------------------------------------

       private long generateAccountNumber()

     {

        Random r = new Random();        // Seed the random number genertor with the system time

         return 10000 + r.nextInt(89999);        // .nextInt(89999) will return a value between 0 and 89999)

      }

}

8 0
4 years ago
Which server-based authentication protocol would be best for an organization that wants to apply authorization policies on a per
BARSIC [14]

Answer:

TACACS+

Explanation:

TACACS+ or terminal access controller access-control system plus is an open standard protocol developed by Cisco. It encrypts all communication in a network ( including the password and data sent) and supports a separate authentication, authorisation and accounting policies for access to a centralised database.

It also uses the transport layer protocol TCP for a reliable data communication.

6 0
4 years ago
The image uses a school of fish to symbolize leadership.
timurjin [86]
Front is the answer because the fish is in red while the rest are in blue
5 0
4 years ago
Read 2 more answers
Other questions:
  • Which description best describes how mass spectroscopy is useful in the field of forensic toxicology
    6·1 answer
  • _____ can analyze the content of social media communications within the context of a specific brand or product and determine wha
    13·1 answer
  • What is the main difference between a fileserver and network attached storage (NAS)?
    10·1 answer
  • Which of the following technique is well suited to support very large address space, e.g. 64-bit address space? Select one: a. C
    11·1 answer
  • Why can it be helpful to perform mathematical calculations using programming? Choose the best answer.
    11·1 answer
  • LAB: Parsing dates in M/D/Y format
    5·1 answer
  • Write its features:features of computer ​
    15·1 answer
  • Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    12·1 answer
  • Place a check next to each of the choices that describe an example of proper ergonomics. (more than 1 answer)
    7·2 answers
  • 15. You read a news article that's politically biased and not well organized. It's
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!